diff options
author | unknown <guilhem@gbichot4.local> | 2008-01-11 22:48:54 +0100 |
---|---|---|
committer | unknown <guilhem@gbichot4.local> | 2008-01-11 22:48:54 +0100 |
commit | 17f0738885d2f0889f0671b12fd85f47858e1f6d (patch) | |
tree | 3a191e9519c1a455e18187a59a5d934e06db584f /mysql-test/t/maria-recovery.test | |
parent | 7bfb3446a0ef838c06fb53566d543000c0b62d0e (diff) | |
download | mariadb-git-17f0738885d2f0889f0671b12fd85f47858e1f6d.tar.gz |
WL#3072 Maria Recovery
All statements doing an implicit commit now also do one in Maria.
This is useful because LOCK TABLES; REPAIR; crash; is not rollback-able,
the implicit commit of REPAIR avoid that Recovery tries to rollback
and fails.
Fix for BUG#33827 "COMMIT AND CHAIN causes serious Valgrind error"
(maybe not the definite one, depends on the assigned dev).
mysql-test/t/maria-recovery.test:
test of REPAIR's implicit commit. I cannot commit the result file
because maria-recovery fails in vanilla tree (seen in pushbuild) but
its new section looks like:
repair table t1;
Table Op Msg_type Msg_text
mysqltest.t1 repair status OK
insert into t1 values(2);
select * from t1;
a
1
2
3
SET SESSION debug="+d,maria_flush_whole_log,maria_flush_whole_page_cache,maria_crash";
* crashing mysqld intentionally
set global maria_checkpoint_interval=1;
ERROR HY000: Lost connection to MySQL server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
failure
use mysqltest;
select * from t1;
a
1
3
Which is as it should be.
sql/rpl_injector.cc:
fix for BUG#33827
sql/sql_parse.cc:
- All DDLs and mysql_admin_table() (REPAIR etc) use end_actrive_trans()
to do an implicit commit so we add there an implicit commit of the
Maria transaction.
- Fix for BUG#33827
storage/maria/ha_maria.cc:
- A method to do implicit commit in Maria
- After an implicit commit, if it was under LOCK TABLES, the locked
tables have a stale file->trn: update it.
storage/maria/ha_maria.h:
new static method
storage/maria/ma_check.c:
bugfix: this disabling of transactionality had the effect that if
LOCK TABLES; REPAIR; INSERT then the INSERT ran non-transactional
(so couldn't be undone in case of crash, if, by bad chance, its
effect on pages went to disk).
storage/maria/ma_checkpoint.c:
indentation
storage/maria/ma_recovery.c:
dbug statements
storage/maria/trnman.c:
When doing an implicit commit we need to know the number of locked
tables of the committed transaction and copy it to the new transaction
storage/maria/trnman_public.h:
prototype change
Diffstat (limited to 'mysql-test/t/maria-recovery.test')
-rw-r--r-- | mysql-test/t/maria-recovery.test | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/maria-recovery.test b/mysql-test/t/maria-recovery.test index 51191bd09ee..b8633a661e9 100644 --- a/mysql-test/t/maria-recovery.test +++ b/mysql-test/t/maria-recovery.test @@ -234,6 +234,29 @@ let $mvr_crash_statement= set global maria_checkpoint_interval=1; -- source include/maria_verify_recovery.inc drop table t1; +--echo Test of REPAIR's implicit commit + +let $mms_tables=1; +create table t1 (a varchar(100), key(a)) engine=maria; +let $mvr_restore_old_snapshot=0; +let $mms_compare_physically=0; +let $mvr_crash_statement= set global maria_checkpoint_interval=1; + +let $mvr_debug_option="+d,maria_flush_whole_log,maria_flush_whole_page_cache,maria_crash"; +insert into t1 values(3); +-- source include/maria_make_snapshot_for_comparison.inc +lock tables t1 write; +insert into t1 values (1); +repair table t1; +insert into t1 values(2); +select * from t1; + +# checksum comparison failure is expected, SELECT output matters +-- source include/maria_verify_recovery.inc +# 2 should be missing (rolled back) but 1 should be committed +select * from t1; +drop table t1; + # # Test with big blobs # |