mirror of
https://github.com/MariaDB/server.git
synced 2025-11-08 00:28:29 +03:00
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
36 lines
1.2 KiB
Plaintext
36 lines
1.2 KiB
Plaintext
set autocommit=1;
|
|
reset master;
|
|
create table bug16206 (a int);
|
|
insert into bug16206 values(1);
|
|
start transaction;
|
|
insert into bug16206 values(2);
|
|
commit;
|
|
show binlog events;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
|
|
f n Query 1 n use `test`; create table bug16206 (a int)
|
|
f n Query 1 n use `test`; insert into bug16206 values(1)
|
|
f n Query 1 n use `test`; insert into bug16206 values(2)
|
|
drop table bug16206;
|
|
reset master;
|
|
create table bug16206 (a int) engine= bdb;
|
|
insert into bug16206 values(0);
|
|
insert into bug16206 values(1);
|
|
start transaction;
|
|
insert into bug16206 values(2);
|
|
commit;
|
|
insert into bug16206 values(3);
|
|
show binlog events;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
|
|
f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
|
|
f n Query 1 n use `test`; insert into bug16206 values(0)
|
|
f n Query 1 n use `test`; insert into bug16206 values(1)
|
|
f n Query 1 n use `test`; BEGIN
|
|
f n Query 1 n use `test`; insert into bug16206 values(2)
|
|
f n Query 1 n use `test`; COMMIT
|
|
f n Query 1 n use `test`; insert into bug16206 values(3)
|
|
drop table bug16206;
|
|
set autocommit=0;
|
|
End of 5.0 tests
|