summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-12-02 17:22:17 +0200
committerMichael Widenius <monty@askmonty.org>2011-12-02 17:22:17 +0200
commit9d0ea0ab4bd4b4be302ca63ddbcc47fd3a4a8c7d (patch)
treeef73ec10fc04760ef566a464fbe58a7629000779
parent02963d45e37e85619e33f49d82e26157c8b580f6 (diff)
downloadmariadb-git-9d0ea0ab4bd4b4be302ca63ddbcc47fd3a4a8c7d.tar.gz
Fixed bug where automaticly zerofilled table was not part of recovery if crash happended before next checkpoint.
mysql-test/suite/maria/r/maria-autozerofill.result: Updated test case storage/maria/ha_maria.cc: Write create_rename_lsn for auto_zerofilled tables. storage/maria/ma_delete.c: Added DBUG_ASSERT() to find errors when deleting pages. storage/maria/ma_locking.c: Fixed typo storage/maria/ma_open.c: Don't regard file as movable if create_rename_lsn is not LSN_NEEDS_NEW_STATE_LSNS
-rw-r--r--mysql-test/suite/maria/r/maria-autozerofill.result3
-rw-r--r--storage/maria/ha_maria.cc4
-rw-r--r--storage/maria/ma_delete.c1
-rw-r--r--storage/maria/ma_locking.c2
-rw-r--r--storage/maria/ma_open.c5
5 files changed, 12 insertions, 3 deletions
diff --git a/mysql-test/suite/maria/r/maria-autozerofill.result b/mysql-test/suite/maria/r/maria-autozerofill.result
index ad0ea32362a..81df4cbab90 100644
--- a/mysql-test/suite/maria/r/maria-autozerofill.result
+++ b/mysql-test/suite/maria/r/maria-autozerofill.result
@@ -13,8 +13,7 @@ a
Warnings:
Error 1194 t1' is marked as crashed and should be repaired
flush table t1;
-Status: changed,sorted index pages,zerofilled,movable
-create_rename_lsn has magic value
+Status: changed,sorted index pages,zerofilled
insert into t1 values(2);
flush table t1;
create_rename_lsn has non-magic value
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 2afa32e4f01..cbe91791bee 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -1425,8 +1425,12 @@ int ha_maria::zerofill(THD * thd, HA_CHECK_OPT *check_opt)
if (!error)
{
+ TrID create_trid= trnman_get_min_safe_trid();
pthread_mutex_lock(&share->intern_lock);
+ share->state.changed|= STATE_NOT_MOVABLE;
maria_update_state_info(&param, file, UPDATE_TIME | UPDATE_OPEN_COUNT);
+ _ma_update_state_lsns_sub(share, LSN_IMPOSSIBLE, create_trid,
+ TRUE, TRUE);
pthread_mutex_unlock(&share->intern_lock);
}
return error;
diff --git a/storage/maria/ma_delete.c b/storage/maria/ma_delete.c
index a4e485066f5..a2e2d9b040c 100644
--- a/storage/maria/ma_delete.c
+++ b/storage/maria/ma_delete.c
@@ -247,6 +247,7 @@ my_bool _ma_ck_real_delete(register MARIA_HA *info, MARIA_KEY *key,
if (page.size <= page.node + share->keypage_header + 1)
{
+ DBUG_ASSERT(page.size == page.node + share->keypage_header);
if (page.node)
*root= _ma_kpos(page.node, root_buff +share->keypage_header +
page.node);
diff --git a/storage/maria/ma_locking.c b/storage/maria/ma_locking.c
index acc359ff212..078c0602d9b 100644
--- a/storage/maria/ma_locking.c
+++ b/storage/maria/ma_locking.c
@@ -398,7 +398,7 @@ int _ma_mark_file_changed(register MARIA_SHARE *share)
/*
For transactional tables, the table is marked changed when the first page
is written. Here we just mark the state to be updated so that caller
- can do 'anaylze table' and find that is has changed before any pages
+ can do 'analyze table' and find that is has changed before any pages
are written.
*/
if (! test_all_bits(share->state.changed,
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 3f15749ced5..fc98945d582 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -748,6 +748,11 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
HA_ERR_CRASHED_ON_REPAIR : HA_ERR_CRASHED_ON_USAGE);
goto err;
}
+ else
+ {
+ /* create_rename_lsn != LSN_NEEDS_NEW_STATE_LSNS */
+ share->state.changed|= STATE_NOT_MOVABLE;
+ }
}
else
share->page_type= PAGECACHE_PLAIN_PAGE;