mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 11:31:51 +01:00
89f3fec1e3
The lock_type is upgrade to TL_WRITE from TL_WRITE_DELAYED for INSERT DELAYED when inserting multi values in one statement. It's safe. But it causes an unsafe warning in SBR. Make INSERT DELAYED safe by logging it as INSERT without DELAYED. mysql-test/extra/binlog_tests/binlog_insert_delayed.test: Updated the test file to test multi INSERT DELAYED statement is no longer causes an unsafe warning and binlogged as INSERT without DELAYED. mysql-test/extra/rpl_tests/create_recursive_construct.inc: Updated for the patch of bug#54579. mysql-test/suite/binlog/r/binlog_row_binlog.result: Updated for the patch of bug#54579. mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result: Test result for BUG#54579. mysql-test/suite/binlog/r/binlog_stm_binlog.result: Updated for the patch of bug#54579. mysql-test/suite/binlog/r/binlog_unsafe.result: Updated for the patch of bug#54579. mysql-test/suite/binlog/t/binlog_unsafe.test: Updated for the patch of bug#54579. sql/sql_insert.cc: Added code to genetate a new query string for removing DELAYED keyword for multi INSERT DEALAYED statement. sql/sql_yacc.yy: Added code to record the DELAYED keyword position and remove the setting of unsafe statement for INSERT DELAYED statement
51 lines
2.1 KiB
Text
51 lines
2.1 KiB
Text
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
|
|
insert delayed into t1 values (207);
|
|
insert delayed into t1 values (null);
|
|
insert delayed into t1 values (300);
|
|
FLUSH TABLES;
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query # # BEGIN
|
|
master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT' COLLATE 'latin1_swedish_ci'))
|
|
master-bin.000001 # Query # # COMMIT
|
|
master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
|
|
master-bin.000001 # Query # # BEGIN
|
|
master-bin.000001 # Query # # use `test`; insert delayed into t1 values (207)
|
|
master-bin.000001 # Query # # COMMIT
|
|
master-bin.000001 # Query # # BEGIN
|
|
master-bin.000001 # Intvar # # INSERT_ID=208
|
|
master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null)
|
|
master-bin.000001 # Query # # COMMIT
|
|
master-bin.000001 # Query # # BEGIN
|
|
master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300)
|
|
master-bin.000001 # Query # # COMMIT
|
|
master-bin.000001 # Query # # use `test`; FLUSH TABLES
|
|
RESET MASTER;
|
|
insert /* before delayed */ delayed /* after delayed */ into t1 values (null),(null),(null),(null);
|
|
insert /*! delayed */ into t1 values (null),(null),(400),(null);
|
|
FLUSH TABLES;
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query # # BEGIN
|
|
master-bin.000001 # Intvar # # INSERT_ID=301
|
|
master-bin.000001 # Query # # use `test`; insert /* before delayed */ /* after delayed */ into t1 values (null),(null),(null),(null)
|
|
master-bin.000001 # Query # # COMMIT
|
|
master-bin.000001 # Query # # BEGIN
|
|
master-bin.000001 # Intvar # # INSERT_ID=305
|
|
master-bin.000001 # Query # # use `test`; insert /*! */ into t1 values (null),(null),(400),(null)
|
|
master-bin.000001 # Query # # COMMIT
|
|
master-bin.000001 # Query # # use `test`; FLUSH TABLES
|
|
select * from t1;
|
|
a
|
|
207
|
|
208
|
|
300
|
|
301
|
|
302
|
|
303
|
|
304
|
|
305
|
|
306
|
|
400
|
|
401
|
|
drop table t1;
|