Skip to content

Commit 9153fdd

Browse files
author
Rohit Kalhans
committed
Backout the patch for bug#11758263.
1 parent 6df5a61 commit 9153fdd

27 files changed

+26
-153
lines changed

mysql-test/extra/rpl_tests/rpl_insert_id_pk.test

-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
# We also check how the foreign_key_check variable is replicated
1111

1212
-- source include/master-slave.inc
13-
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
14-
1513
#should work for both SBR and RBR
1614

1715
create table t1(a int auto_increment, primary key(a));
@@ -52,7 +50,6 @@ create table t2(b int auto_increment, c int, primary key(b));
5250
insert into t1 values (10);
5351
insert into t1 values (null),(null),(null);
5452
insert into t2 values (5,0);
55-
--disable_warnings ONCE
5653
insert into t2 (c) select * from t1 ORDER BY a;
5754
select * from t2 ORDER BY b;
5855
sync_slave_with_master;

mysql-test/extra/rpl_tests/rpl_multi_update.test

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
source include/master-slave.inc;
22

3-
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
4-
53
eval CREATE TABLE t1 (
64
a int unsigned not null auto_increment primary key,
75
b int unsigned
@@ -13,15 +11,13 @@ eval CREATE TABLE t2 (
1311
) ENGINE=$engine_type;
1412

1513
INSERT INTO t1 VALUES (NULL, 0);
16-
--disable_warnings ONCE
1714
INSERT INTO t1 SELECT NULL, 0 FROM t1;
1815

1916
INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
2017

2118
SELECT * FROM t1 ORDER BY a;
2219
SELECT * FROM t2 ORDER BY a;
2320

24-
--disable_warnings ONCE
2521
UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
2622
sync_slave_with_master;
2723

mysql-test/extra/rpl_tests/rpl_multi_update2.test

-3
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,13 @@ eval CREATE TABLE t2 (
1717
) ENGINE=$engine_type;
1818

1919
INSERT INTO t1 VALUES (NULL, 0);
20-
21-
--disable_warnings ONCE
2220
INSERT INTO t1 SELECT NULL, 0 FROM t1;
2321

2422
INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
2523

2624
SELECT * FROM t1 ORDER BY a;
2725
SELECT * FROM t2 ORDER BY a;
2826

29-
--disable_warnings ONCE
3027
UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a;
3128
SELECT * FROM t1 ORDER BY a;
3229
SELECT * FROM t2 ORDER BY a;

mysql-test/extra/rpl_tests/rpl_multi_update3.test

-3
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,13 @@ eval CREATE TABLE t2 (
1818
) ENGINE=$engine_type;
1919

2020
INSERT INTO t1 VALUES (NULL, 0);
21-
22-
--disable_warnings ONCE
2321
INSERT INTO t1 SELECT NULL, 0 FROM t1;
2422

2523
INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
2624

2725
SELECT * FROM t1 ORDER BY a;
2826
SELECT * FROM t2 ORDER BY a;
2927

30-
--disable_warnings ONCE
3128
UPDATE t2, (SELECT a FROM t1 ORDER BY a) AS t SET t2.b = t.a+5 ;
3229
SELECT * FROM t1 ORDER BY a;
3330
SELECT * FROM t2 ORDER BY a;

mysql-test/r/ps.result

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
21
drop table if exists t1,t2,t3,t4;
32
drop database if exists client_test_db;
43
create table t1

mysql-test/suite/binlog/r/binlog_unsafe.result

+18-37
Large diffs are not rendered by default.

mysql-test/suite/binlog/t/binlog_unsafe.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ while ($unsafe_type < 9) {
233233
--let $value_0=
234234
--let $sel_sidef_0=
235235
--let $sel_retval_0=
236-
--let $CRC_ARG_expected_number_of_warnings= 7
236+
--let $CRC_ARG_expected_number_of_warnings= 6
237237
}
238238

239239
if ($unsafe_type == 8) {

mysql-test/suite/rpl/r/rpl_auto_increment_11932.result

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
include/master-slave.inc
22
[connection master]
3-
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
43
drop database if exists test1;
54
create database test1;
65
use test1;

mysql-test/suite/rpl/r/rpl_insert_id_pk.result

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
include/master-slave.inc
22
[connection master]
3-
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
43
create table t1(a int auto_increment, primary key(a));
54
create table t2(b int auto_increment, c int, primary key(b));
65
insert into t1 values (1),(2),(3);

mysql-test/suite/rpl/r/rpl_multi_update.result

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
include/master-slave.inc
22
[connection master]
3-
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
43
CREATE TABLE t1 (
54
a int unsigned not null auto_increment primary key,
65
b int unsigned

mysql-test/suite/rpl/r/rpl_multi_update2.result

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
include/master-slave.inc
22
[connection master]
3-
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
43
drop table if exists t1,t2;
54
CREATE TABLE t1 (
65
a int unsigned not null auto_increment primary key,

mysql-test/suite/rpl/r/rpl_multi_update3.result

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
include/master-slave.inc
22
[connection master]
3-
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
43

54
-------- Test for BUG#9361 --------
65
CREATE TABLE t1 (

mysql-test/suite/rpl/r/rpl_rotate_logs.result

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
21
start slave;
32
Got one of the listed errors
43
start slave;

mysql-test/suite/rpl/t/rpl_auto_increment_11932.test

-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# Test supplied by Are Casilla
99

1010
source include/master-slave.inc;
11-
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
1211
--disable_warnings
1312
connection master;
1413
drop database if exists test1;
@@ -43,16 +42,12 @@ CREATE PROCEDURE simpleproc3 ()
4342
$
4443
DELIMITER ;$
4544

46-
--disable_warnings
4745
CALL simpleproc3();
48-
--enable_warnings
4946

5047
select * from t2;
5148

5249
TRUNCATE TABLE `t1`;
53-
--disable_warnings
5450
CALL simpleproc3();
55-
--enable_warnings
5651

5752
select * from t1;
5853

mysql-test/suite/rpl/t/rpl_multi_update2.test

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#######################################################
77
--source include/not_ndb_default.inc
88
--source include/master-slave.inc
9-
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
109
let $engine_type=MyISAM;
1110
--source extra/rpl_tests/rpl_multi_update2.test
1211
--source include/rpl_end.inc

mysql-test/suite/rpl/t/rpl_multi_update3.test

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#######################################################
77
--source include/not_ndb_default.inc
88
--source include/master-slave.inc
9-
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
109
let $engine_type=MyISAM;
1110
-- source extra/rpl_tests/rpl_multi_update3.test
1211
--source include/rpl_end.inc

mysql-test/suite/rpl/t/rpl_optimize.test

-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ enable_query_log;
1919

2020
create table t1 (a int not null auto_increment primary key, b int, key(b));
2121
INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
22-
--disable_warnings
2322
INSERT INTO t1 (a) SELECT null FROM t1;
2423
INSERT INTO t1 (a) SELECT null FROM t1;
2524
INSERT INTO t1 (a) SELECT null FROM t1;
@@ -33,7 +32,6 @@ INSERT INTO t1 (a) SELECT null FROM t1;
3332
INSERT INTO t1 (a) SELECT null FROM t1;
3433
INSERT INTO t1 (a) SELECT null FROM t1;
3534
INSERT INTO t1 (a) SELECT null FROM t1;
36-
--enable_warnings
3735
save_master_pos;
3836
# a few updates to force OPTIMIZE to do something
3937
--disable_warnings

mysql-test/suite/rpl/t/rpl_rotate_logs.test

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ EOF
2727
chmod 0000 $MYSQLD_SLAVE_DATADIR/master.info;
2828
connection slave;
2929

30-
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
3130
# START SLAVE will fail because it can't read the file (mode 000)
3231
# (system error 13)
3332
--replace_result $MYSQL_TEST_DIR TESTDIR

mysql-test/suite/rpl/t/rpl_semi_sync_event.test

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ SET GLOBAL event_scheduler = ON;
5252
replace_result $engine_type ENGINE_TYPE;
5353
eval CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=$engine_type;
5454
INSERT INTO t1 (f) VALUES ('a'),('a'),('a'),('a'),('a');
55-
--disable_warnings
5655
INSERT INTO t1 SELECT i+5, f FROM t1;
5756
INSERT INTO t1 SELECT i+10, f FROM t1;
58-
--enable_warnings
57+
5958
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
6059
DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev1_',CONNECTION_ID()));
6160
CREATE EVENT ev2 ON SCHEDULE EVERY 1 SECOND

mysql-test/suite/rpl/t/rpl_timezone.test

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
# timezone used in CONVERT_TZ is not binlogged. To debug (by Guilhem
1414
# and possibly Konstantin).
1515

16-
source include/master-slave.inc;
17-
1816
--disable_query_log
1917
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
2018
--enable_query_log
2119

2220
--disable_ps_protocol
2321

22+
source include/master-slave.inc;
23+
2424
# Save original timezone
2525
set @my_time_zone= @@global.time_zone;
2626

@@ -90,7 +90,6 @@ insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
9090
# from originally inserted)
9191
#
9292
set time_zone='MET';
93-
--disable_warnings ONCE
9493
insert into t2 (select * from t1);
9594
SELECT * FROM t1 ORDER BY n;
9695
sync_slave_with_master;

mysql-test/t/multi_update.test

-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(1
352352
insert into t1 values (0,'A01-Comp',1);
353353
insert into t1 values (0,'B01-Comp',1);
354354
insert into t2 values (0,1,'A Note',1);
355-
--disable_warnings ONCE
356355
update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2;
357356
select * from t1;
358357
select * from t2;

mysql-test/t/ps.test

-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
-- source include/not_embedded.inc
22
-- source include/have_log_bin.inc
3-
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
43
#
54
# SQL Syntax for Prepared Statements test
65
#
@@ -433,7 +432,6 @@ deallocate prepare stmt;
433432
create table t1 (a int);
434433
insert into t1 values (1),(2),(3);
435434
create table t2 select * from t1;
436-
--disable_warnings
437435
prepare stmt FROM 'create table t2 select * from t1';
438436
drop table t2;
439437
execute stmt;
@@ -443,7 +441,6 @@ execute stmt;
443441
execute stmt;
444442
drop table t2;
445443
execute stmt;
446-
--enable_warnings
447444
drop table t1,t2;
448445
deallocate prepare stmt;
449446

@@ -1179,15 +1176,13 @@ create database mysqltest character set utf8;
11791176
prepare stmt1 from "create table mysqltest.t1 (c char(10))";
11801177
prepare stmt2 from "create table mysqltest.t2 select 'test'";
11811178
execute stmt1;
1182-
--disable_warnings ONCE
11831179
execute stmt2;
11841180
show create table mysqltest.t1;
11851181
show create table mysqltest.t2;
11861182
drop table mysqltest.t1;
11871183
drop table mysqltest.t2;
11881184
alter database mysqltest character set latin1;
11891185
execute stmt1;
1190-
--disable_warnings ONCE
11911186
execute stmt2;
11921187
show create table mysqltest.t1;
11931188
show create table mysqltest.t2;

sql/share/errmsg-utf8.txt

-8
Original file line numberDiff line numberDiff line change
@@ -6486,11 +6486,3 @@ ER_PLUGIN_NO_UNINSTALL
64866486

64876487
ER_PLUGIN_NO_INSTALL
64886488
eng "Plugin '%s' is marked as not dynamically installable. You have to stop the server to install it."
6489-
6490-
6491-
ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT
6492-
eng "Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave."
6493-
6494-
ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC
6495-
eng "CREATE TABLE... SELECT... on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slave."
6496-

sql/sql_base.cc

+1-40
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ static bool auto_repair_table(THD *thd, TABLE_LIST *table_list);
214214
static void free_cache_entry(TABLE *entry);
215215
static bool
216216
has_write_table_with_auto_increment(TABLE_LIST *tables);
217-
static bool
218-
has_write_table_with_auto_increment_and_select(TABLE_LIST *tables);
217+
219218

220219
uint cached_open_tables(void)
221220
{
@@ -5684,11 +5683,6 @@ bool lock_tables(THD *thd, TABLE_LIST *tables, uint count,
56845683
/* We have to emulate LOCK TABLES if we are statement needs prelocking. */
56855684
if (thd->lex->requires_prelocking())
56865685
{
5687-
5688-
if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables &&
5689-
has_write_table_with_auto_increment_and_select(tables))
5690-
thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT);
5691-
56925686
/*
56935687
A query that modifies autoinc column in sub-statement can make the
56945688
master and slave inconsistent.
@@ -9086,39 +9080,6 @@ has_write_table_with_auto_increment(TABLE_LIST *tables)
90869080
return 0;
90879081
}
90889082

9089-
/*
9090-
checks if the tables have select tables in the table list and write tables
9091-
with auto-increment column.
9092-
9093-
SYNOPSIS
9094-
has_two_write_locked_tables_with_auto_increment_and_select
9095-
tables Table list
9096-
9097-
RETURN VALUES
9098-
9099-
-true if the table list has atleast one table with auto-increment column
9100-
and atleast one table to select from.
9101-
-false otherwise
9102-
*/
9103-
9104-
static bool
9105-
has_write_table_with_auto_increment_and_select(TABLE_LIST *tables)
9106-
{
9107-
bool has_select= false;
9108-
bool has_auto_increment_tables = has_write_table_with_auto_increment(tables);
9109-
for(TABLE_LIST *table= tables; table; table= table->next_global)
9110-
{
9111-
if (!table->placeholder() &&
9112-
(table->lock_type <= TL_READ_NO_INSERT))
9113-
{
9114-
has_select= true;
9115-
break;
9116-
}
9117-
}
9118-
return(has_select && has_auto_increment_tables);
9119-
}
9120-
9121-
91229083

91239084
/*
91249085
Open and lock system tables for read.

sql/sql_lex.cc

-2
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@ Query_tables_list::binlog_stmt_unsafe_errcode[BINLOG_STMT_UNSAFE_COUNT] =
6161
ER_BINLOG_UNSAFE_MIXED_STATEMENT,
6262
ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT,
6363
ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE,
64-
ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT,
6564
ER_BINLOG_UNSAFE_REPLACE_SELECT,
6665
ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT,
6766
ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT,
68-
ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC,
6967
ER_BINLOG_UNSAFE_UPDATE_IGNORE
7068
};
7169

sql/sql_lex.h

-15
Original file line numberDiff line numberDiff line change
@@ -1268,13 +1268,6 @@ class Query_tables_list
12681268
*/
12691269
BINLOG_STMT_UNSAFE_INSERT_SELECT_UPDATE,
12701270

1271-
/**
1272-
Query that writes to a table with auto_inc column after selecting from
1273-
other tables are unsafe as the order in which the rows are retrieved by
1274-
select may differ on master and slave.
1275-
*/
1276-
BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT,
1277-
12781271
/**
12791272
INSERT...REPLACE SELECT is unsafe because which rows are replaced depends
12801273
on the order that rows are retrieved by SELECT. This order cannot be
@@ -1296,14 +1289,6 @@ class Query_tables_list
12961289
*/
12971290
BINLOG_STMT_UNSAFE_CREATE_REPLACE_SELECT,
12981291

1299-
/**
1300-
CREATE TABLE...SELECT on a table with auto-increment column is unsafe
1301-
because which rows are replaced depends on the order that rows are
1302-
retrieved from SELECT. This order cannot be predicted and may differ on
1303-
master and the slave
1304-
*/
1305-
BINLOG_STMT_UNSAFE_CREATE_SELECT_AUTOINC,
1306-
13071292
/**
13081293
UPDATE...IGNORE is unsafe because which rows are ignored depends on the
13091294
order that rows are updated. This order cannot be predicted and may differ

0 commit comments

Comments
 (0)