From e6cf286b5dcebc78332cdf05d6e20d9ae39d1875 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Wed, 11 Aug 2010 00:58:08 +0300 Subject: Fixed LP#605798 RQG: Table corruption after Maria engine recovery - "Wrong data in bitmap" maria_chk & maria_read_log now reads block size from control file. mysql-test/suite/maria/r/maria.result: Updated results after trivial change of maria_chk's output storage/maria/ma_bitmap.c: More DBUG_PRINT storage/maria/ma_blockrec.c: Fixed bug that we didn't mark page full in bitmap if directory is full storage/maria/ma_check.c: Write out if directory is full for errors in bitmap storage/maria/ma_control_file.c: Don't give error for wrong block size if block size is 0 storage/maria/maria_chk.c: Read block size from control file In case of -dvv, write also out bitmap information (good for debugging) storage/maria/maria_read_log.c: Read block size from control file Fixed that maria_read_log works with different page size than TRANSLOG_PAGE_SIZE --- storage/maria/ma_control_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'storage/maria/ma_control_file.c') diff --git a/storage/maria/ma_control_file.c b/storage/maria/ma_control_file.c index 1e1fc34c77e..ac246f09337 100644 --- a/storage/maria/ma_control_file.c +++ b/storage/maria/ma_control_file.c @@ -398,7 +398,7 @@ CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing, } new_block_size= uint2korr(buffer + CF_BLOCKSIZE_OFFSET); - if (new_block_size != maria_block_size) + if (new_block_size != maria_block_size && maria_block_size) { error= CONTROL_FILE_WRONG_BLOCKSIZE; sprintf(errmsg_buff, @@ -407,6 +407,7 @@ CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing, errmsg= errmsg_buff; goto err; } + maria_block_size= new_block_size; if (my_checksum(0, buffer, new_cf_create_time_size - CF_CHECKSUM_SIZE) != uint4korr(buffer + new_cf_create_time_size - CF_CHECKSUM_SIZE)) -- cgit v1.2.1