mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Backport Bug #45827 Stmt using two autoinc values does not produce unsafe warning
One statement that have more than one different tables to update with autoinc columns just was marked as unsafe in mixed mode, so the unsafe warning can't be produced in statement mode. To fix the problem, mark the statement as unsafe in statement mode too. mysql-test/extra/rpl_tests/rpl_insert_id.test: The test case is updated due to the patch of bug#45827. mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result: The test result is updated due to the patch of bug#45827. mysql-test/suite/binlog/r/binlog_unsafe.result: Test result for bug#45827. mysql-test/suite/binlog/t/binlog_unsafe.test: Added test to verify if stmt that have more than one different tables to update with autoinc columns will produce unsafe warning mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result: The test result is updated due to the patch of bug#45827. mysql-test/suite/rpl/t/rpl_trigger.test: The test case is updated due to the patch of bug#45827. mysql-test/suite/rpl/t/rpl_variables_stm.test: The test case is updated due to the patch of bug#45827. sql/sql_base.cc: Reomved the 'set_current_stmt_binlog_row_based_if_mixed' function for producing unsafe warnings by executing 'decide_logging_format' function later in statement mode
This commit is contained in:
@ -456,7 +456,11 @@ return n;
|
||||
end|
|
||||
reset master;
|
||||
insert into t2 values (bug27417(1));
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
insert into t2 select bug27417(2);
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
reset master;
|
||||
insert into t2 values (bug27417(2));
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
@ -473,6 +477,8 @@ select count(*) from t2;
|
||||
count(*)
|
||||
2
|
||||
delete from t2 where a=bug27417(3);
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
select count(*) from t2 /* nothing got deleted */;
|
||||
count(*)
|
||||
2
|
||||
@ -485,6 +491,8 @@ select count(*) from t1 /* must be 5 */;
|
||||
count(*)
|
||||
5
|
||||
delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
affected rows: 0
|
||||
select count(*) from t1 /* must be 7 */;
|
||||
count(*)
|
||||
@ -700,7 +708,11 @@ return n;
|
||||
end|
|
||||
reset master;
|
||||
insert into t2 values (bug27417(1));
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
insert into t2 select bug27417(2);
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
reset master;
|
||||
insert into t2 values (bug27417(2));
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
@ -716,6 +728,8 @@ select count(*) from t2;
|
||||
count(*)
|
||||
2
|
||||
delete from t2 where a=bug27417(3);
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
select count(*) from t2 /* nothing got deleted */;
|
||||
count(*)
|
||||
2
|
||||
@ -727,6 +741,8 @@ select count(*) from t1 /* must be 5 */;
|
||||
count(*)
|
||||
5
|
||||
delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
affected rows: 0
|
||||
select count(*) from t1 /* must be 7 */;
|
||||
count(*)
|
||||
|
Reference in New Issue
Block a user