mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
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
This commit is contained in:
parent
7bfb3446a0
commit
17f0738885
12 changed files with 173 additions and 12 deletions
|
|
@ -62,9 +62,9 @@ uint trnman_increment_locked_tables(TRN *trn)
|
|||
return trn->locked_tables++;
|
||||
}
|
||||
|
||||
my_bool trnman_has_locked_tables(TRN *trn)
|
||||
uint trnman_has_locked_tables(TRN *trn)
|
||||
{
|
||||
return trn->locked_tables != 0;
|
||||
return trn->locked_tables;
|
||||
}
|
||||
|
||||
uint trnman_decrement_locked_tables(TRN *trn)
|
||||
|
|
@ -72,9 +72,9 @@ uint trnman_decrement_locked_tables(TRN *trn)
|
|||
return --trn->locked_tables;
|
||||
}
|
||||
|
||||
void trnman_reset_locked_tables(TRN *trn)
|
||||
void trnman_reset_locked_tables(TRN *trn, uint locked_tables)
|
||||
{
|
||||
trn->locked_tables= 0;
|
||||
trn->locked_tables= locked_tables;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue