From 81258f14323e1d1ad0203bae93bc55a30d47c1b3 Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 2 Apr 2021 22:00:36 +0300 Subject: MDEV-17913 Encrypted transactional Aria tables remain corrupt after crash recovery, automatic repairment does not work This was because of a wrong test in encryption code that wrote random numbers over the LSN for pages for transactional Aria tables during repair. The effect was that after an ALTER TABLE ENABLE KEYS of a encrypted recovery of the tables would not work. Fixed by changing testing of !share->now_transactional to !share->base.born_transactional. Other things: - Extended Aria check_table() to check for wrong (= too big) LSN numbers. - If check_table() failed just because of wrong LSN or TRN numbers, a following repair table will just do a zerofill which is much faster. - Limit number of LSN errors in one check table to MAX_LSN_ERROR (10). - Removed old obsolete test of 'if (error_count & 2)'. Changed error_count and warning_count from bits to numbers of errors/warnings as this is more useful. --- include/myisamchk.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/myisamchk.h b/include/myisamchk.h index f1a7348eea0..f9a55ba467f 100644 --- a/include/myisamchk.h +++ b/include/myisamchk.h @@ -70,7 +70,7 @@ typedef struct st_handler_check_param */ ulonglong unique_count[HA_MAX_KEY_SEG + 1]; ulonglong notnull_count[HA_MAX_KEY_SEG + 1]; - + ulonglong max_allowed_lsn; my_off_t search_after_block; my_off_t new_file_pos, key_file_blocks; my_off_t keydata, totaldata, key_blocks, start_check_pos; @@ -96,6 +96,7 @@ typedef struct st_handler_check_param uint out_flag, error_printed, verbose; uint opt_sort_key, total_files, max_level; uint key_cache_block_size, pagecache_block_size; + uint skip_lsn_error_count; int tmpfile_createflag, err_count; myf myf_rw; uint16 language; -- cgit v1.2.1