Commit e016a2f5 authored by Sergei Golubchik's avatar Sergei Golubchik

lp:705210 Compiling with BUILD/compile-pentium64-debug fails

parent c41b66c0
...@@ -902,10 +902,10 @@ void my_diff_and_hrtime(my_timediff_t *interval, my_hrtime_t *timestamp); ...@@ -902,10 +902,10 @@ void my_diff_and_hrtime(my_timediff_t *interval, my_hrtime_t *timestamp);
extern ulonglong my_getsystime(void); extern ulonglong my_getsystime(void);
#define my_micro_time() (my_getsystime()/10) #define my_micro_time() (my_getsystime()/10)
#define hrtime_to_time(X) ((my_time_t)((X).val/1000000)) #define hrtime_to_time(X) ((X).val/1000000)
#define hrtime_from_time(X) ((ulonglong)((X)*1000000ULL)) #define hrtime_from_time(X) ((ulonglong)((X)*1000000ULL))
#define hrtime_to_double(X) ((X).val/1e6) #define hrtime_to_double(X) ((X).val/1e6)
#define hrtime_sec_part(X) ((X).val%1000000) #define hrtime_sec_part(X) ((ulong)((X).val%1000000))
#define my_time(X) hrtime_to_time(my_hrtime()) #define my_time(X) hrtime_to_time(my_hrtime())
#define my_micro_and_hrtime(X,Y) my_diff_and_hrtime(X,Y) #define my_micro_and_hrtime(X,Y) my_diff_and_hrtime(X,Y)
......
...@@ -158,9 +158,12 @@ static inline longlong sec_part_unshift(longlong second_part, int digits) ...@@ -158,9 +158,12 @@ static inline longlong sec_part_unshift(longlong second_part, int digits)
} }
static inline ulong sec_part_truncate(ulong second_part, int digits) static inline ulong sec_part_truncate(ulong second_part, int digits)
{ {
return second_part - second_part % log_10_int[MAX_SEC_PART_DIGITS - digits]; /* the cast here should be unnecessary! */
return second_part - second_part % (ulong)log_10_int[MAX_SEC_PART_DIGITS - digits];
} }
#define hrtime_to_my_time(X) ((my_time_t)hrtime_to_time(X))
/* /*
Available interval types used in any statement. Available interval types used in any statement.
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "mysys_priv.h" #include "mysys_priv.h"
#include <m_string.h> #include <m_string.h>
#include <my_time.h>
/* /*
get date as string get date as string
......
...@@ -108,10 +108,7 @@ void my_diff_and_hrtime(my_timediff_t *interval, my_hrtime_t *timestamp) ...@@ -108,10 +108,7 @@ void my_diff_and_hrtime(my_timediff_t *interval, my_hrtime_t *timestamp)
{ {
interval->val= my_getsystime() / 10; interval->val= my_getsystime() / 10;
#if defined(__WIN__) || defined(HAVE_GETHRTIME) #if defined(__WIN__) || defined(HAVE_GETHRTIME)
{ *timestamp= my_hrtime();
my_hrtime_t t= my_hrtime();
timestamp->val= t.val;
}
#else #else
timestamp->val= interval->val; timestamp->val= interval->val;
#endif #endif
......
...@@ -1351,7 +1351,7 @@ longlong pack_time(MYSQL_TIME *my_time) ...@@ -1351,7 +1351,7 @@ longlong pack_time(MYSQL_TIME *my_time)
my_time->second_part) * (my_time->neg ? -1 : 1); my_time->second_part) * (my_time->neg ? -1 : 1);
} }
#define get_one(WHERE, FACTOR) WHERE= packed % FACTOR; packed/= FACTOR #define get_one(WHERE, FACTOR) WHERE= (ulong)(packed % FACTOR); packed/= FACTOR
MYSQL_TIME *unpack_time(longlong packed, MYSQL_TIME *my_time) MYSQL_TIME *unpack_time(longlong packed, MYSQL_TIME *my_time)
{ {
......
This diff is collapsed.
...@@ -873,7 +873,7 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg, ...@@ -873,7 +873,7 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
longlong res; longlong res;
if (t_type == MYSQL_TIMESTAMP_TIME) if (t_type == MYSQL_TIMESTAMP_TIME)
res= number_to_time(value, &buf, &was_cut); res= number_to_time((double)value, &buf, &was_cut);
else else
res= number_to_datetime(value, &buf, TIME_INVALID_DATES|TIME_FUZZY_DATE, res= number_to_datetime(value, &buf, TIME_INVALID_DATES|TIME_FUZZY_DATE,
&was_cut); &was_cut);
......
...@@ -1610,7 +1610,7 @@ void Item_func_sysdate_local::store_now_in_TIME(MYSQL_TIME *now_time) ...@@ -1610,7 +1610,7 @@ void Item_func_sysdate_local::store_now_in_TIME(MYSQL_TIME *now_time)
{ {
THD *thd= current_thd; THD *thd= current_thd;
my_hrtime_t now= my_hrtime(); my_hrtime_t now= my_hrtime();
thd->variables.time_zone->gmt_sec_to_TIME(now_time, hrtime_to_time(now)); thd->variables.time_zone->gmt_sec_to_TIME(now_time, hrtime_to_my_time(now));
set_sec_part(hrtime_sec_part(now), now_time, this); set_sec_part(hrtime_sec_part(now), now_time, this);
thd->time_zone_used= 1; thd->time_zone_used= 1;
} }
......
...@@ -1719,11 +1719,11 @@ beg: ...@@ -1719,11 +1719,11 @@ beg:
case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_DATETIME:
{ {
size_t d, t; uint d, t;
uint64 i64= uint8korr(ptr); /* YYYYMMDDhhmmss */ uint64 i64= uint8korr(ptr); /* YYYYMMDDhhmmss */
d= i64 / 1000000; d= (uint)(i64 / 1000000);
t= i64 % 1000000; t= (uint)(i64 % 1000000);
my_b_printf(file, "%04d-%02d-%02d %02d:%02d:%02d", my_b_printf(file, "%04u-%02u-%02u %02u:%02u:%02u",
d / 10000, (d % 10000) / 100, d % 100, d / 10000, (d % 10000) / 100, d % 100,
t / 10000, (t % 10000) / 100, t % 100); t / 10000, (t % 10000) / 100, t % 100);
my_snprintf(typestr, typestr_length, "DATETIME"); my_snprintf(typestr, typestr_length, "DATETIME");
......
...@@ -1022,7 +1022,7 @@ public: ...@@ -1022,7 +1022,7 @@ public:
return when; return when;
} }
my_hrtime_t hrtime= my_hrtime(); my_hrtime_t hrtime= my_hrtime();
when= hrtime_to_time(hrtime); when= hrtime_to_my_time(hrtime);
when_sec_part= hrtime_sec_part(hrtime); when_sec_part= hrtime_sec_part(hrtime);
return when; return when;
} }
......
...@@ -2154,7 +2154,7 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli) ...@@ -2154,7 +2154,7 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli)
if (!ev->when) if (!ev->when)
{ {
my_hrtime_t hrtime= my_hrtime(); my_hrtime_t hrtime= my_hrtime();
ev->when= hrtime_to_time(hrtime); ev->when= hrtime_to_my_time(hrtime);
ev->when_sec_part= hrtime_sec_part(hrtime); ev->when_sec_part= hrtime_sec_part(hrtime);
} }
ev->thd = thd; // because up to this point, ev->thd == 0 ev->thd = thd; // because up to this point, ev->thd == 0
......
...@@ -2026,7 +2026,7 @@ public: ...@@ -2026,7 +2026,7 @@ public:
{ {
if (user_time.val) if (user_time.val)
{ {
start_time= hrtime_to_time(user_time); start_time= hrtime_to_my_time(user_time);
start_time_sec_part= hrtime_sec_part(user_time); start_time_sec_part= hrtime_sec_part(user_time);
start_utime= utime_after_lock= my_micro_time(); start_utime= utime_after_lock= my_micro_time();
} }
...@@ -2035,7 +2035,7 @@ public: ...@@ -2035,7 +2035,7 @@ public:
my_hrtime_t hrtime; my_hrtime_t hrtime;
my_timediff_t timediff; my_timediff_t timediff;
my_micro_and_hrtime(&timediff, &hrtime); my_micro_and_hrtime(&timediff, &hrtime);
start_time= hrtime_to_time(hrtime); start_time= hrtime_to_my_time(hrtime);
start_time_sec_part= hrtime_sec_part(hrtime); start_time_sec_part= hrtime_sec_part(hrtime);
utime_after_lock= start_utime= timediff.val; utime_after_lock= start_utime= timediff.val;
} }
...@@ -2043,13 +2043,13 @@ public: ...@@ -2043,13 +2043,13 @@ public:
inline void set_current_time() inline void set_current_time()
{ {
my_hrtime_t hrtime= my_hrtime(); my_hrtime_t hrtime= my_hrtime();
start_time= hrtime_to_time(hrtime); start_time= hrtime_to_my_time(hrtime);
start_time_sec_part= hrtime_sec_part(hrtime); start_time_sec_part= hrtime_sec_part(hrtime);
} }
inline void set_time(my_hrtime_t t) inline void set_time(my_hrtime_t t)
{ {
user_time= t; user_time= t;
start_time= hrtime_to_time(user_time); start_time= hrtime_to_my_time(user_time);
start_time_sec_part= hrtime_sec_part(user_time); start_time_sec_part= hrtime_sec_part(user_time);
start_utime= utime_after_lock= my_micro_time(); start_utime= utime_after_lock= my_micro_time();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment