diff options
author | Monty <monty@mariadb.org> | 2021-06-07 15:38:38 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2021-06-07 20:51:32 +0300 |
commit | eed419b487dd6f555cdfd92aa0756fdec1b9060f (patch) | |
tree | de412ae734fd3f9e750e29b021d79670d2fdd697 | |
parent | 310dff5d847b3c117ab6bca8e6ccbcc8bca818d9 (diff) | |
download | mariadb-git-eed419b487dd6f555cdfd92aa0756fdec1b9060f.tar.gz |
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
-rw-r--r-- | storage/maria/ma_check.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index e1c85cd2d44..5b37cac74d5 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -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, |