Commit eed419b4 authored by Monty's avatar Monty

Fixed a DBUG_ASSERT when running zerofill() on aria tables

This happended when an aria table was already used by the system before
running zerofill, which could happen with Aria system tables.

Fixed by using a proper page type when reading pages in zerofill
parent 310dff5d
......@@ -3413,6 +3413,9 @@ static my_bool maria_zerofill_index(HA_CHECK *param, MARIA_HA *info,
my_bool zero_lsn= (share->base.born_transactional &&
!(param->testflag & T_ZEROFILL_KEEP_LSN));
int error= 1;
enum pagecache_page_type page_type= (share->base.born_transactional ?
PAGECACHE_LSN_PAGE :
PAGECACHE_PLAIN_PAGE);
DBUG_ENTER("maria_zerofill_index");
if (!(param->testflag & T_SILENT))
......@@ -3427,7 +3430,7 @@ static my_bool maria_zerofill_index(HA_CHECK *param, MARIA_HA *info,
if (!(buff= pagecache_read(share->pagecache,
&share->kfile, page,
DFLT_INIT_HITS, 0,
PAGECACHE_PLAIN_PAGE, PAGECACHE_LOCK_WRITE,
page_type, PAGECACHE_LOCK_WRITE,
&page_link.link)))
{
pagecache_unlock_by_link(share->pagecache, page_link.link,
......@@ -3504,6 +3507,9 @@ static my_bool maria_zerofill_data(HA_CHECK *param, MARIA_HA *info,
uint block_size= share->block_size;
MARIA_FILE_BITMAP *bitmap= &share->bitmap;
my_bool zero_lsn= !(param->testflag & T_ZEROFILL_KEEP_LSN), error;
enum pagecache_page_type read_page_type= (share->base.born_transactional ?
PAGECACHE_LSN_PAGE :
PAGECACHE_PLAIN_PAGE);
DBUG_ENTER("maria_zerofill_data");
/* This works only with BLOCK_RECORD files */
......@@ -3527,7 +3533,7 @@ static my_bool maria_zerofill_data(HA_CHECK *param, MARIA_HA *info,
if (!(buff= pagecache_read(share->pagecache,
&info->dfile,
page, 1, 0,
PAGECACHE_PLAIN_PAGE, PAGECACHE_LOCK_WRITE,
read_page_type, PAGECACHE_LOCK_WRITE,
&page_link.link)))
{
_ma_check_print_error(param,
......
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