Skip to content
Permalink
Browse files
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
  • Loading branch information
montywi committed Jun 7, 2021
1 parent 310dff5 commit eed419b
Showing 1 changed file with 8 additions and 2 deletions.
@@ -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,

0 comments on commit eed419b

Please sign in to comment.