Skip to content

Commit a38b937

Browse files
author
Jan Lindström
committed
MDEV-25201 : Assertion `thd->wsrep_trx_meta.gtid.seqno == (-1)' failed in int wsrep_to_isolation_begin(THD*, const char*, const char*, const TABLE_LIST*, Alter_info*)
Test case does not assert anymore but works incorrectly. We should not replicate PREPARE using TOI.
1 parent e32c21c commit a38b937

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

mysql-test/suite/galera/r/enforce_storage_engine2.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CREATE TABLE t1(i INT) ENGINE=INNODB;
77
CREATE TABLE t2(i INT) ENGINE=MYISAM;
88
Warnings:
99
Note 1266 Using storage engine InnoDB for table 't2'
10+
Note 1266 Using storage engine InnoDB for table 't2'
1011
connection node_2;
1112
SHOW TABLES;
1213
Tables_in_test

mysql-test/suite/galera/r/galera_myisam_transactions.result

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,12 @@ SELECT COUNT(*) = 0 FROM t2;
3535
COUNT(*) = 0
3636
1
3737
DROP TABLE t1, t2, t3;
38+
SET SESSION lock_wait_timeout=2;
39+
SET GLOBAL wsrep_replicate_myisam= ON;
40+
CREATE TEMPORARY TABLE t1 (i INT, PRIMARY KEY pk (i)) ENGINE=MyISAM;
41+
PREPARE stmt FROM "INSERT INTO t1 (id) SELECT * FROM (SELECT 4 AS i) AS y";
42+
INSERT INTO t1 VALUES(4);
43+
DEALLOCATE PREPARE stmt;
44+
COMMIT;
45+
DROP TABLE t1;
46+
SET GLOBAL wsrep_replicate_myisam=OFF;

mysql-test/suite/galera/t/galera_myisam_transactions.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,16 @@ SELECT COUNT(*) = 0 FROM t2;
3434
SELECT COUNT(*) = 0 FROM t2;
3535

3636
DROP TABLE t1, t2, t3;
37+
38+
#
39+
# MDEV-25201 : Assertion `thd->wsrep_trx_meta.gtid.seqno == (-1)' failed in int wsrep_to_isolation_begin(THD*, const char*, const char*, const TABLE_LIST*, Alter_info*)
40+
#
41+
SET SESSION lock_wait_timeout=2;
42+
SET GLOBAL wsrep_replicate_myisam= ON;
43+
CREATE TEMPORARY TABLE t1 (i INT, PRIMARY KEY pk (i)) ENGINE=MyISAM;
44+
PREPARE stmt FROM "INSERT INTO t1 (id) SELECT * FROM (SELECT 4 AS i) AS y";
45+
INSERT INTO t1 VALUES(4);
46+
DEALLOCATE PREPARE stmt;
47+
COMMIT;
48+
DROP TABLE t1;
49+
SET GLOBAL wsrep_replicate_myisam=OFF;

sql/sql_base.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4227,6 +4227,7 @@ bool open_tables(THD *thd, const DDL_options_st &options,
42274227
wsrep_thd_exec_mode(thd) == LOCAL_STATE &&
42284228
!is_stat_table((*start)->db, (*start)->alias) &&
42294229
thd->get_command() != COM_STMT_PREPARE &&
4230+
!thd->stmt_arena->is_stmt_prepare() &&
42304231
((thd->lex->sql_command == SQLCOM_INSERT ||
42314232
thd->lex->sql_command == SQLCOM_INSERT_SELECT ||
42324233
thd->lex->sql_command == SQLCOM_REPLACE ||

0 commit comments

Comments
 (0)