mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 22:12:30 +01:00
19c380aaff
Non-transactional updates that take place inside a transaction present problems for logging because they are visible to other clients before the transaction is committed, and they are not rolled back even if the transaction is rolled back. It is not always possible to log correctly in statement format when both transactional and non-transactional tables are used in the same transaction. In the current patch, we ensure that such scenario is completely safe under the ROW and MIXED modes.
42 lines
1.9 KiB
Text
42 lines
1.9 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 binlogged in 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
|
|
insert delayed into t1 values (null),(null),(null),(null);
|
|
Warnings:
|
|
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted.
|
|
insert delayed into t1 values (null),(null),(400),(null);
|
|
Warnings:
|
|
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted.
|
|
select * from t1;
|
|
a
|
|
207
|
|
208
|
|
300
|
|
301
|
|
302
|
|
303
|
|
304
|
|
305
|
|
306
|
|
400
|
|
401
|
|
drop table t1;
|