summaryrefslogtreecommitdiff
path: root/mysql-test/t/ps.test
diff options
context:
space:
mode:
authorRohit Kalhans <rohit.kalhans@oracle.com>2012-02-08 00:33:08 +0530
committerRohit Kalhans <rohit.kalhans@oracle.com>2012-02-08 00:33:08 +0530
commit7306edf09e964099c48b9feaeb4237d89969f9d4 (patch)
treead0d8d355079009a9bed9b3d9a84fc0c55cdcb24 /mysql-test/t/ps.test
parent99208a484585af197d59ccb0c29541bb87081ed8 (diff)
downloadmariadb-git-7306edf09e964099c48b9feaeb4237d89969f9d4.tar.gz
BUG#11758263 50440: MARK UNORDERED UPDATE WITH AUTOINC UNSAFE
Problem: Statements that write to tables with auto_increment columns based on the selection from another table, may lead to master and slave going out of sync, as the order in which the rows are retrived from the table may differ on master and slave. Solution: We mark writing to a table with auto_increment table as unsafe. This will cause the execution of such statements to throw a warning and forces the statement to be logged in ROW if the logging format is mixed. Changes: 1. All the statements that writes to a table with auto_increment column(s) based on the rows fetched from another table, will now be unsafe. 2. CREATE TABLE with SELECT will now be unsafe. sql/share/errmsg-utf8.txt: Added new Warning messages sql/sql_base.cc: created a new function that checks for select + write on a autoinc table made all such statements to be unsafe. sql/sql_parse.cc: made create autoincremnet tabble + select unsafe
Diffstat (limited to 'mysql-test/t/ps.test')
-rw-r--r--mysql-test/t/ps.test5
1 files changed, 5 insertions, 0 deletions
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index e00bd785789..4c525c5320e 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -1,5 +1,6 @@
-- source include/not_embedded.inc
-- source include/have_log_bin.inc
+call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
#
# SQL Syntax for Prepared Statements test
#
@@ -432,6 +433,7 @@ deallocate prepare stmt;
create table t1 (a int);
insert into t1 values (1),(2),(3);
create table t2 select * from t1;
+--disable_warnings
prepare stmt FROM 'create table t2 select * from t1';
drop table t2;
execute stmt;
@@ -441,6 +443,7 @@ execute stmt;
execute stmt;
drop table t2;
execute stmt;
+--enable_warnings
drop table t1,t2;
deallocate prepare stmt;
@@ -1176,6 +1179,7 @@ create database mysqltest character set utf8;
prepare stmt1 from "create table mysqltest.t1 (c char(10))";
prepare stmt2 from "create table mysqltest.t2 select 'test'";
execute stmt1;
+--disable_warnings ONCE
execute stmt2;
show create table mysqltest.t1;
show create table mysqltest.t2;
@@ -1183,6 +1187,7 @@ drop table mysqltest.t1;
drop table mysqltest.t2;
alter database mysqltest character set latin1;
execute stmt1;
+--disable_warnings ONCE
execute stmt2;
show create table mysqltest.t1;
show create table mysqltest.t2;