Skip to content

Commit 9a3360c

Browse files
committed
MDEV-36265: Unique error for changing Domain ID with open temporary tables
Signed-off-by: Kristian Nielsen <[email protected]>
1 parent feb1cf9 commit 9a3360c

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
8181
INSERT INTO t2 VALUES (1);
8282
SET SESSION gtid_domain_id= 0;
8383
SET SESSION gtid_domain_id= 204;
84-
ERROR HY000: Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transaction
84+
ERROR HY000: Cannot modify @@session.gtid_domain_id while there are open temporary tables being binlogged
8585
SET SESSION binlog_format=statement;
8686
INSERT INTO t2 VALUES (2);
8787
SET SESSION gtid_domain_id= 205;
88-
ERROR HY000: Cannot modify @@session.gtid_domain_id or @@session.gtid_seq_no inside a transaction
88+
ERROR HY000: Cannot modify @@session.gtid_domain_id while there are open temporary tables being binlogged
8989
DROP TEMPORARY TABLE t2;
9090
SET SESSION gtid_domain_id= @old_domain;
9191
SET SESSION binlog_format= @old_mode;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ SET SESSION gtid_domain_id= 0;
9999
CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
100100
INSERT INTO t2 VALUES (1);
101101
SET SESSION gtid_domain_id= 0;
102-
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
102+
--error ER_TEMPORARY_TABLES_PREVENT_SWITCH_GTID_DOMAIN_ID
103103
SET SESSION gtid_domain_id= 204;
104104
SET SESSION binlog_format=statement;
105105
INSERT INTO t2 VALUES (2);
106-
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO
106+
--error ER_TEMPORARY_TABLES_PREVENT_SWITCH_GTID_DOMAIN_ID
107107
SET SESSION gtid_domain_id= 205;
108108
DROP TEMPORARY TABLE t2;
109109
SET SESSION gtid_domain_id= @old_domain;

sql/share/errmsg-utf8.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -12296,4 +12296,6 @@ WARN_INDEX_HINTS_IGNORED
1229612296
eng "Index hints are ignored because they are incompatible with RETURNING clause"
1229712297
ukr "Підказки по використанню индексів ігноруются тому що вони несумісні з RETURNING"
1229812298
ER_SIGNAL_SKIP_ROW_FROM_TRIGGER
12299-
eng "The row is skipped by a trigger implementation"
12299+
eng "The row is skipped by a trigger implementation"
12300+
ER_TEMPORARY_TABLES_PREVENT_SWITCH_GTID_DOMAIN_ID
12301+
eng "Cannot modify @@session.gtid_domain_id while there are open temporary tables being binlogged"

sql/sys_vars.cc

+1-6
Original file line numberDiff line numberDiff line change
@@ -1978,17 +1978,12 @@ check_gtid_domain_id(sys_var *self, THD *thd, set_var *var)
19781978
domains, temporary table must be exclusive to a single thread.
19791979
In row-based binlogging, temporary tables do not end up in the binlog,
19801980
so there is no such issue.
1981-
1982-
ToDo: When merging to next (non-GA) release, introduce a more specific
1983-
error that describes that the problem is changing gtid_domain_id with
1984-
open temporary tables in statement/mixed binlogging mode; it is not
1985-
really due to doing it inside a "transaction".
19861981
*/
19871982
if (thd->has_thd_temporary_tables() &&
19881983
!thd->is_current_stmt_binlog_format_row() &&
19891984
var->save_result.ulonglong_value != thd->variables.gtid_domain_id)
19901985
{
1991-
my_error(ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_GTID_DOMAIN_ID_SEQ_NO,
1986+
my_error(ER_TEMPORARY_TABLES_PREVENT_SWITCH_GTID_DOMAIN_ID,
19921987
MYF(0));
19931988
return true;
19941989
}

0 commit comments

Comments
 (0)