[Commits] a335d6b: MDEV-6948:SET STATEMENT gtid_domain_id = ... FOR has no effect (same for gtid_seq_no and server_id)

sanja at mariadb.com sanja at mariadb.com
Fri Nov 28 18:43:34 EET 2014


revision-id: a335d6b4a450042955d634dd09338637686ea885
parent(s): 65af9535718426e912657acd4c7f7013fd65c389
committer: Oleksandr Byelkin
branch nick: work-maria-10.1-MDEV-6997
timestamp: 2014-11-28 17:43:31 +0100
message:

MDEV-6948:SET STATEMENT gtid_domain_id = ... FOR has no effect (same for gtid_seq_no and server_id)

test suite for MDEV-7006

---
 mysql-test/r/set_statement.result                  |  2 --
 .../r/set_statement_notembedded_binlog.result      | 19 +++++++++++++++++++
 mysql-test/t/set_statement.test                    |  2 --
 mysql-test/t/set_statement_notembedded_binlog.test | 22 ++++++++++++++++++++++
 sql/sys_vars.cc                                    |  4 ++--
 5 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/mysql-test/r/set_statement.result b/mysql-test/r/set_statement.result
index 34aee21..641052b 100644
--- a/mysql-test/r/set_statement.result
+++ b/mysql-test/r/set_statement.result
@@ -1120,8 +1120,6 @@ set @@slow_query_log= @save_slow_query_log;
 set @@long_query_time= @save_long_query_time;
 set statement autocommit=default for select 1;
 ERROR 42000: The system variable autocommit cannot be set in SET STATEMENT.
-set statement gtid_domain_id=default for select 1;
-ERROR 42000: The system variable gtid_domain_id cannot be set in SET STATEMENT.
 set statement tx_isolation=default for select 1;
 ERROR 42000: The system variable tx_isolation cannot be set in SET STATEMENT.
 set statement rand_seed1=default for select 1;
diff --git a/mysql-test/r/set_statement_notembedded_binlog.result b/mysql-test/r/set_statement_notembedded_binlog.result
new file mode 100644
index 0000000..03c4915
--- /dev/null
+++ b/mysql-test/r/set_statement_notembedded_binlog.result
@@ -0,0 +1,19 @@
+drop table if exists t1;
+drop view if exists t1;
+#
+# MDEV-6948: SET STATEMENT gtid_domain_id = ... FOR has no effect
+# (same for gtid_seq_no and server_id)
+#
+PURGE BINARY LOGS before now();
+create table t1 (i int);
+set gtid_domain_id = 10;
+insert into t1 values (1),(2);
+set statement gtid_domain_id = 20 for insert into t1 values (3),(4);
+show binlog events limit 9,5;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+x	x	x	x	x	BEGIN GTID 10-1-1
+x	x	x	x	x	use `test`; insert into t1 values (1),(2)
+x	x	x	x	x	COMMIT
+x	x	x	x	x	BEGIN GTID 20-1-1
+x	x	x	x	x	use `test`; set statement gtid_domain_id = 20 for insert into t1 values (3),(4)
+drop table t1;
diff --git a/mysql-test/t/set_statement.test b/mysql-test/t/set_statement.test
index d10a425..951a36e 100644
--- a/mysql-test/t/set_statement.test
+++ b/mysql-test/t/set_statement.test
@@ -1046,8 +1046,6 @@ set @@long_query_time= @save_long_query_time;
 --error ER_SET_STATEMENT_NOT_SUPPORTED
 set statement autocommit=default for select 1;
 --error ER_SET_STATEMENT_NOT_SUPPORTED
-set statement gtid_domain_id=default for select 1;
---error ER_SET_STATEMENT_NOT_SUPPORTED
 set statement tx_isolation=default for select 1;
 --error ER_SET_STATEMENT_NOT_SUPPORTED
 set statement rand_seed1=default for select 1;
diff --git a/mysql-test/t/set_statement_notembedded_binlog.test b/mysql-test/t/set_statement_notembedded_binlog.test
new file mode 100644
index 0000000..70d7ef7
--- /dev/null
+++ b/mysql-test/t/set_statement_notembedded_binlog.test
@@ -0,0 +1,22 @@
+--source include/have_log_bin.inc
+--source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1;
+drop view if exists t1;
+--enable_warnings
+
+--echo #
+--echo # MDEV-6948: SET STATEMENT gtid_domain_id = ... FOR has no effect
+--echo # (same for gtid_seq_no and server_id)
+--echo #
+PURGE BINARY LOGS before now();
+create table t1 (i int);
+set gtid_domain_id = 10;
+insert into t1 values (1),(2);
+set statement gtid_domain_id = 20 for insert into t1 values (3),(4);
+
+--replace_column 1 x 2 x 3 x 4 x 5 x
+show binlog events limit 9,5;
+
+drop table t1;
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 7405521..767d174 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1437,7 +1437,7 @@ static Sys_var_uint Sys_gtid_domain_id(
        "parallel paths (for example multiple masters), each independent "
        "source server must use a distinct domain_id. For simple tree-shaped "
        "replication topologies, it can be left at its default, 0.",
-       NO_SET_STMT SESSION_VAR(gtid_domain_id),
+       SESSION_VAR(gtid_domain_id),
        CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, UINT_MAX32), DEFAULT(0),
        BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG,
        ON_CHECK(check_gtid_domain_id));
@@ -2037,7 +2037,7 @@ static Sys_var_ulong Sys_min_examined_row_limit(
        "min_examined_row_limit",
        "Don't write queries to slow log that examine fewer rows "
        "than that",
-       NO_SET_STMT SESSION_VAR(min_examined_row_limit), CMD_LINE(REQUIRED_ARG),
+       SESSION_VAR(min_examined_row_limit), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1));
 
 #ifdef _WIN32


More information about the commits mailing list