mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 11:31:51 +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.
28 lines
1.2 KiB
Text
28 lines
1.2 KiB
Text
drop table if exists t1;
|
|
reset master;
|
|
create table t1 (a int);
|
|
prepare s from "insert into t1 values (@a),(?)";
|
|
set @a=98;
|
|
execute s using @a;
|
|
prepare s from "insert into t1 values (?)";
|
|
set @a=99;
|
|
execute s using @a;
|
|
prepare s from "insert into t1 select 100 limit ?";
|
|
set @a=100;
|
|
execute s using @a;
|
|
Warnings:
|
|
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query # # use `test`; create table t1 (a int)
|
|
master-bin.000001 # Query # # BEGIN
|
|
master-bin.000001 # User var # # @`a`=98
|
|
master-bin.000001 # Query # # use `test`; insert into t1 values (@a),(98)
|
|
master-bin.000001 # Query # # COMMIT
|
|
master-bin.000001 # Query # # BEGIN
|
|
master-bin.000001 # Query # # use `test`; insert into t1 values (99)
|
|
master-bin.000001 # Query # # COMMIT
|
|
master-bin.000001 # Query # # BEGIN
|
|
master-bin.000001 # Query # # use `test`; insert into t1 select 100 limit 100
|
|
master-bin.000001 # Query # # COMMIT
|
|
drop table t1;
|