Commit b8c56780 authored by unknown's avatar unknown

Fix for pushbuild problems: innocuous Valgrind error (uninitialized

bytes in unimportant, unused pieces of index pages) and test failure
because test requires Maria. Compiler warning.
About Valgrind error, two of the three bzero() added here are
needed to silence the error (the third is added for symmetry).


mysql-test/t/maria-gis-rtree.test:
  requires Maria
storage/maria/ma_loghandler.c:
  "uint64->uint16 possible loss of precision" on Windows
storage/maria/ma_rt_index.c:
  We bzero the entire new page, as is done in _ma_enlarge_root()
  for B-tree pages. This silences Valgrind warnings and allows
  better compression.
storage/maria/ma_rt_split.c:
  We bzero the entire new page, as is done in _ma_enlarge_root()
  for B-tree pages. This silences Valgrind warnings and allows
  better compression.
parent b29d8bd2
-- source include/have_maria.inc
-- source include/have_geometry.inc
set storage_engine=maria;
......
......@@ -8332,7 +8332,11 @@ static uchar *dump_chunk(uchar *buffer, uchar *ptr)
}
break;
}
length= translog_get_total_chunk_length(buffer, ptr - buffer);
{
intptr offset= ptr - buffer;
DBUG_ASSERT(offset >= 0 && offset <= UINT_MAX16);
length= translog_get_total_chunk_length(buffer, (uint16)offset);
}
printf(" Length %u\n", length);
ptr+= length;
return ptr;
......
......@@ -666,7 +666,7 @@ static int maria_rtree_insert_level(MARIA_HA *info, uint keynr, uchar *key,
HA_OFFSET_ERROR)
DBUG_RETURN(-1);
info->keyread_buff_used= 1;
bzero(info->buff, share->keypage_header);
bzero(info->buff, share->block_size);
_ma_store_keynr(share, info->buff, keynr);
_ma_store_page_used(share, info->buff, share->keypage_header);
......@@ -703,7 +703,7 @@ static int maria_rtree_insert_level(MARIA_HA *info, uint keynr, uchar *key,
DBUG_RETURN(-1); /* purecov: inspected */
}
bzero(new_root_buf, share->keypage_header);
bzero(new_root_buf, share->block_size);
if (nod_flag)
_ma_store_keypage_flag(share, new_root_buf, KEYPAGE_FLAG_ISNOD);
_ma_store_keynr(share, new_root_buf, keynr);
......
......@@ -317,6 +317,7 @@ int maria_rtree_split_page(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
err_code= -1;
goto split_err;
}
bzero(new_page, share->block_size);
stop= task + (max_keys + 1);
cur1= rt_PAGE_FIRST_KEY(share, page, nod_flag);
......@@ -342,7 +343,6 @@ int maria_rtree_split_page(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
memcpy(to - nod_flag, cur->key - nod_flag, full_length);
}
bzero(new_page, share->keypage_header);
if (nod_flag)
_ma_store_keypage_flag(share, new_page, KEYPAGE_FLAG_ISNOD);
_ma_store_keynr(share, new_page, keyinfo->key_nr);
......
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