From 0cf7e502ee8f9d14f3136d00e6b420a35881ffd6 Mon Sep 17 00:00:00 2001 From: "mats@kindahl-laptop.dnsalias.net" <> Date: Wed, 13 Jun 2007 12:28:35 +0200 Subject: [PATCH] BUG#23051 (READ COMMITTED breaks mixed and statement-based replication): Post-merge fixes. --- mysql-test/r/binlog_innodb.result | 4 ++-- mysql-test/r/binlog_multi_engine.result | 19 ++++++++++--------- mysql-test/r/ndb_binlog_basic2.result | 12 ------------ mysql-test/t/binlog_multi_engine.test | 14 +++++++------- mysql-test/t/ndb_binlog_basic2.test | 15 --------------- mysql-test/t/partition_hash.test | 2 +- sql/sql_class.h | 7 ++++--- 7 files changed, 24 insertions(+), 49 deletions(-) delete mode 100644 mysql-test/r/ndb_binlog_basic2.result delete mode 100644 mysql-test/t/ndb_binlog_basic2.test diff --git a/mysql-test/r/binlog_innodb.result b/mysql-test/r/binlog_innodb.result index 61f5ad19f0d..4970d5d0a9e 100644 --- a/mysql-test/r/binlog_innodb.result +++ b/mysql-test/r/binlog_innodb.result @@ -14,12 +14,12 @@ SET BINLOG_FORMAT=STATEMENT; BEGIN; SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; UPDATE t1 SET b = 1*a WHERE a > 1; -ERROR HY000: Logging not possible. Message: InnoDB: Transaction level 'READ-UNCOMMITTED' is not safe for binlog mode 'STATEMENT' +ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-UNCOMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT' COMMIT; BEGIN; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; UPDATE t1 SET b = 2*a WHERE a > 2; -ERROR HY000: Logging not possible. Message: InnoDB: Transaction level 'READ-COMMITTED' is not safe for binlog mode 'STATEMENT' +ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT' COMMIT; BEGIN; SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; diff --git a/mysql-test/r/binlog_multi_engine.result b/mysql-test/r/binlog_multi_engine.result index 7af4525d887..a0a0a40bd0e 100644 --- a/mysql-test/r/binlog_multi_engine.result +++ b/mysql-test/r/binlog_multi_engine.result @@ -5,12 +5,12 @@ SET SESSION BINLOG_FORMAT=STATEMENT; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); -ERROR HY000: Attempting to log statement in in statement format, but statement format is not possible with this combination of engines +ERROR HY000: Binary logging not possible. Message: Statement-based format required for this statement, but not allowed by this combination of engines UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; -ERROR HY000: Attempting to log statement in in statement format, but statement format is not possible with this combination of engines +ERROR HY000: Binary logging not possible. Message: Statement-based format required for this statement, but not allowed by this combination of engines UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; -ERROR HY000: It is not possible to log anything with this combination of engines +ERROR HY000: Binary logging not possible. Message: Statement cannot be logged to the binary log in row-based nor statement-based format TRUNCATE t1m; TRUNCATE t1b; TRUNCATE t1n; @@ -21,20 +21,20 @@ INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; -ERROR HY000: It is not possible to log anything with this combination of engines +ERROR HY000: Binary logging not possible. Message: Statement cannot be logged to the binary log in row-based nor statement-based format TRUNCATE t1m; TRUNCATE t1b; TRUNCATE t1n; SET SESSION BINLOG_FORMAT=ROW; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); -ERROR HY000: Attempting to log statement in in row format, but row format is not possible with this combination of engines +ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; -ERROR HY000: Attempting to log statement in in row format, but row format is not possible with this combination of engines +ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; -ERROR HY000: It is not possible to log anything with this combination of engines +ERROR HY000: Binary logging not possible. Message: Statement cannot be logged to the binary log in row-based nor statement-based format TRUNCATE t1m; TRUNCATE t1b; TRUNCATE t1n; @@ -51,9 +51,10 @@ master-bin.000001 # Query # # use `test`; TRUNCATE t1b master-bin.000001 # Query # # use `test`; TRUNCATE t1n master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2) -master-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2) master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c -master-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f +master-bin.000001 # Table_map # # table_id: # (test.t1m) +master-bin.000001 # Table_map # # table_id: # (test.t1n) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; TRUNCATE t1m master-bin.000001 # Query # # use `test`; TRUNCATE t1b master-bin.000001 # Query # # BEGIN diff --git a/mysql-test/r/ndb_binlog_basic2.result b/mysql-test/r/ndb_binlog_basic2.result deleted file mode 100644 index 9b9f642bd86..00000000000 --- a/mysql-test/r/ndb_binlog_basic2.result +++ /dev/null @@ -1,12 +0,0 @@ -set session binlog_format=row; -ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet -set session binlog_format=statement; -ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet -set global binlog_format=row; -ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet -set global binlog_format=statement; -ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet -set session binlog_format=default; -ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet -set global binlog_format=default; -ERROR HY000: The NDB cluster engine does not support changing the binlog format on the fly yet diff --git a/mysql-test/t/binlog_multi_engine.test b/mysql-test/t/binlog_multi_engine.test index 25c99ff6ca8..1370611f407 100644 --- a/mysql-test/t/binlog_multi_engine.test +++ b/mysql-test/t/binlog_multi_engine.test @@ -9,13 +9,13 @@ SET SESSION BINLOG_FORMAT=STATEMENT; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); -error ER_BINLOG_STMT_FORMAT_FORBIDDEN; +error ER_BINLOG_LOGGING_IMPOSSIBLE; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; -error ER_BINLOG_STMT_FORMAT_FORBIDDEN; +error ER_BINLOG_LOGGING_IMPOSSIBLE; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; -error ER_BINLOG_ENGINES_INCOMPATIBLE; +error ER_BINLOG_LOGGING_IMPOSSIBLE; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; TRUNCATE t1m; @@ -30,7 +30,7 @@ INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; -error ER_BINLOG_ENGINES_INCOMPATIBLE; +error ER_BINLOG_LOGGING_IMPOSSIBLE; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; TRUNCATE t1m; @@ -40,14 +40,14 @@ TRUNCATE t1n; SET SESSION BINLOG_FORMAT=ROW; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); -error ER_BINLOG_ROW_FORMAT_FORBIDDEN; +error ER_BINLOG_LOGGING_IMPOSSIBLE; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); -error ER_BINLOG_ROW_FORMAT_FORBIDDEN; +error ER_BINLOG_LOGGING_IMPOSSIBLE; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; -error ER_BINLOG_ENGINES_INCOMPATIBLE; +error ER_BINLOG_LOGGING_IMPOSSIBLE; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; TRUNCATE t1m; diff --git a/mysql-test/t/ndb_binlog_basic2.test b/mysql-test/t/ndb_binlog_basic2.test deleted file mode 100644 index bcc6b503320..00000000000 --- a/mysql-test/t/ndb_binlog_basic2.test +++ /dev/null @@ -1,15 +0,0 @@ --- source include/have_ndb.inc --- source include/have_log_bin.inc - ---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT -set session binlog_format=row; ---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT -set session binlog_format=statement; ---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT -set global binlog_format=row; ---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT -set global binlog_format=statement; ---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT -set session binlog_format=default; ---error ER_NDB_CANT_SWITCH_BINLOG_FORMAT -set global binlog_format=default; diff --git a/mysql-test/t/partition_hash.test b/mysql-test/t/partition_hash.test index 26a563cd8cc..ca7972cc01c 100644 --- a/mysql-test/t/partition_hash.test +++ b/mysql-test/t/partition_hash.test @@ -134,7 +134,7 @@ drop table t1; --disable_warnings CREATE TABLE t1 (s1 int) ENGINE=BLACKHOLE PARTITION BY HASH (s1); --enable_warnings ---error 0,ER_BINLOG_ROW_FORMAT_FORBIDDEN +--error 0,ER_BINLOG_LOGGING_IMPOSSIBLE INSERT INTO t1 VALUES (0); DROP TABLE t1; diff --git a/sql/sql_class.h b/sql/sql_class.h index 87b73594e78..fe22d182088 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1998,13 +1998,14 @@ class select_create: public select_insert { public: select_create (TABLE_LIST *table_arg, HA_CREATE_INFO *create_info_par, - List &fields_par, - List &keys_par, + Alter_info *alter_info_arg, List &select_fields,enum_duplicates duplic, bool ignore, TABLE_LIST *select_tables_arg) :select_insert (NULL, NULL, &select_fields, 0, 0, duplic, ignore), create_table(table_arg), - create_info(create_info_par), select_tables(select_tables_arg) + create_info(create_info_par), + select_tables(select_tables_arg), + alter_info(alter_info_arg) {} int prepare(List &list, SELECT_LEX_UNIT *u);