Commit 1fdd3e03 authored by Sergei Golubchik's avatar Sergei Golubchik

more fixes for buildbot failures

sql/log_event.cc:
  revert a wrong attempt to get rid of a warning.
  it broke tests on x86
sql/sql_show.cc:
  more fixes for old gcc
parent 1c8278ba
...@@ -1716,9 +1716,11 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr, ...@@ -1716,9 +1716,11 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr,
case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_DATETIME:
{ {
uint64 d, t, i64= uint8korr(ptr); /* YYYYMMDDhhmmss */ /* these must be size_t, because it's what my_b_printf expects for %d */
d= i64 / 1000000; size_t d, t;
t= i64 % 1000000; uint64 i64= uint8korr(ptr); /* YYYYMMDDhhmmss */
d= (size_t)(i64 / 1000000);
t= (size_t)(i64 % 1000000);
my_b_printf(file, "%04d-%02d-%02d %02d:%02d:%02d", my_b_printf(file, "%04d-%02d-%02d %02d:%02d:%02d",
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);
......
...@@ -2253,24 +2253,27 @@ void remove_status_vars(SHOW_VAR *list) ...@@ -2253,24 +2253,27 @@ void remove_status_vars(SHOW_VAR *list)
static void update_key_cache_stat_var(KEY_CACHE *key_cache, size_t ofs) static void update_key_cache_stat_var(KEY_CACHE *key_cache, size_t ofs)
{ {
uint var_no; uint var_no;
switch (ofs) { if (ofs == offsetof(KEY_CACHE, blocks_used) ||
case offsetof(KEY_CACHE, blocks_used): ofs == offsetof(KEY_CACHE, blocks_unused) ||
case offsetof(KEY_CACHE, blocks_unused): ofs == offsetof(KEY_CACHE, global_blocks_changed))
case offsetof(KEY_CACHE, global_blocks_changed): {
var_no= (ofs-offsetof(KEY_CACHE, blocks_used))/sizeof(ulong); var_no= (ofs-offsetof(KEY_CACHE, blocks_used))/sizeof(ulong);
*(ulong *)((char *) key_cache + ofs)= *(ulong *)((char *) key_cache + ofs)=
(ulong) get_key_cache_stat_value(key_cache, var_no); (ulong) get_key_cache_stat_value(key_cache, var_no);
break; return;
case offsetof(KEY_CACHE, global_cache_r_requests): }
case offsetof(KEY_CACHE, global_cache_read):
case offsetof(KEY_CACHE, global_cache_w_requests): if (ofs == offsetof(KEY_CACHE, global_cache_r_requests) ||
case offsetof(KEY_CACHE, global_cache_write): ofs == offsetof(KEY_CACHE, global_cache_read) ||
ofs == offsetof(KEY_CACHE, global_cache_w_requests) ||
ofs == offsetof(KEY_CACHE, global_cache_write))
{
var_no= NUM_LONG_KEY_CACHE_STAT_VARIABLES + var_no= NUM_LONG_KEY_CACHE_STAT_VARIABLES +
(ofs-offsetof(KEY_CACHE, global_cache_w_requests))/ (ofs-offsetof(KEY_CACHE, global_cache_w_requests))/
sizeof(ulonglong); sizeof(ulonglong);
*(ulonglong *)((char *) key_cache + ofs)= *(ulonglong *)((char *) key_cache + ofs)=
get_key_cache_stat_value(key_cache, var_no); get_key_cache_stat_value(key_cache, var_no);
break; return;
} }
} }
......
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