summaryrefslogtreecommitdiff
path: root/storage/maria/ma_check.c
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-09-10 23:27:26 +0300
committerMichael Widenius <monty@askmonty.org>2010-09-10 23:27:26 +0300
commitb9890b054414c26b1f747966eb7128c4ac587beb (patch)
tree184c1414c70fbf95e1bf6c561a7c56d2f4163952 /storage/maria/ma_check.c
parentb7158601d35456fde4167fe44dcf505495b045af (diff)
downloadmariadb-git-b9890b054414c26b1f747966eb7128c4ac587beb.tar.gz
Fix for LP#634943 "marked as crashed", "zerofilling" and "wrong data in bitmap" when recovering Aria tables
This was an interaction of several bugs: - Tables marked as opened was not properly unmarked on recovery if there was not changes since checkpoint - zerofill of tables put wrong data in bitmap if directory for page was full - Tables was thought as 'moved' during recovery if they had a create_lsn bigger than the lsn in the control file. storage/maria/ha_maria.cc: If table is moved and crashed, threat it as crashed. (Not a related to this bug, but still good to have fixed) storage/maria/ma_blockrec.c: Make enough_free_entries_on_page() global storage/maria/ma_blockrec.h: Make enough_free_entries_on_page() global storage/maria/ma_check.c: If directory is full, mark page full. Fixes bug in zerofill storage/maria/ma_open.c: Don't marke files as MOVED during recovery if create_trid > trnman_max_trid, as this fails for tables created after checkpoint. storage/maria/ma_recovery.c: Reset open_count in file that was open during crash and was part of checkpoint. Fixed wrong warning of 'open count' after recovery of files that was not touched since checkpoint. storage/maria/maria_chk.c: Changed not documented option --log-dir to --logdir Document more of the options. Clean up output for --help storage/maria/trnman.c: Added DBUG_PRINT
Diffstat (limited to 'storage/maria/ma_check.c')
-rw-r--r--storage/maria/ma_check.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index ed3a7a46344..3e49088c368 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -3376,7 +3376,7 @@ static my_bool maria_zerofill_data(HA_CHECK *param, MARIA_HA *info,
case TAIL_PAGE:
{
uint max_entry= (uint) buff[DIR_COUNT_OFFSET];
- uint offset, dir_start;
+ uint offset, dir_start, empty_space;
uchar *dir;
if (zero_lsn)
@@ -3389,9 +3389,13 @@ static my_bool maria_zerofill_data(HA_CHECK *param, MARIA_HA *info,
is_head_page ? ~(TrID) 0 : 0,
is_head_page ?
share->base.min_block_length : 0);
+
/* compactation may have increased free space */
+ empty_space= uint2korr(buff + EMPTY_SPACE_OFFSET);
+ if (!enough_free_entries_on_page(share, buff))
+ empty_space= 0; /* Page is full */
if (_ma_bitmap_set(info, page, is_head_page,
- uint2korr(buff + EMPTY_SPACE_OFFSET)))
+ empty_space))
goto err;
/* Zerofill the not used part */