Commit e8142617 authored by unknown's avatar unknown

Fix for pushbuild failure (noticable only on 64-bit)


storage/maria/ma_pagecache.c:
  pagecache->blocks is now long, takes 8 bytes on some platforms.
  The cast to ulonglong in int8store is for those platforms where
  ulong is 32-bit and int8store uses some << shifts, if there are
  (x<<40 is undefined if x is 32-bit).
storage/maria/ma_recovery.c:
  this change corresponds to the one done in ma_pagecache.c: number
  of dirty pages is stored in 8 bytes.
parent d0b9387b
......@@ -3898,7 +3898,7 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache,
LSN *min_rec_lsn)
{
my_bool error= 0;
uint stored_list_size= 0;
ulong stored_list_size= 0;
uint file_hash;
char *ptr;
LSN minimum_rec_lsn= LSN_MAX;
......@@ -3941,8 +3941,8 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache,
}
}
compile_time_assert(sizeof(pagecache->blocks) <= 4);
str->length= 4 + /* number of dirty pages */
compile_time_assert(sizeof(pagecache->blocks) <= 8);
str->length= 8 + /* number of dirty pages */
(4 + /* file */
4 + /* pageno */
LSN_STORE_SIZE /* rec_lsn */
......@@ -3950,8 +3950,8 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache,
if (NULL == (str->str= my_malloc(str->length, MYF(MY_WME))))
goto err;
ptr= str->str;
int4store(ptr, stored_list_size);
ptr+= 4;
int8store(ptr, (ulonglong)stored_list_size);
ptr+= 8;
if (!stored_list_size)
goto end;
for (file_hash= 0; file_hash < PAGECACHE_CHANGED_BLOCKS_HASH; file_hash++)
......
......@@ -2003,7 +2003,7 @@ static MARIA_HA *get_MARIA_HA_from_UNDO_record(const
static LSN parse_checkpoint_record(LSN lsn)
{
uint i;
ulong i;
TRANSLOG_HEADER_BUFFER rec;
tprint(tracef, "Loading data from checkpoint record at LSN (%lu,0x%lx)\n",
......@@ -2087,9 +2087,9 @@ static LSN parse_checkpoint_record(LSN lsn)
}
/* dirty pages */
uint nb_dirty_pages= uint4korr(ptr);
ptr+= 4;
tprint(tracef, "%u dirty pages\n", nb_dirty_pages);
ulong nb_dirty_pages= uint8korr(ptr);
ptr+= 8;
tprint(tracef, "%lu dirty pages\n", nb_dirty_pages);
if (hash_init(&all_dirty_pages, &my_charset_bin, nb_dirty_pages,
offsetof(struct st_dirty_page, file_and_page_id),
sizeof(((struct st_dirty_page *)NULL)->file_and_page_id),
......
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