Skip to content

Commit 8b02e02

Browse files
mkaruzajanlindstrom
authored andcommitted
MDEV-25698 SIGSEGV in wsrep_should_replicate_ddl
If temporary internal table is in use `hton` will not be set. Skip check if DDL should be replicated in this case. Reviewed-by: Jan Lindström <[email protected]>
1 parent 4927bf2 commit 8b02e02

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ Warning 1290 WSREP: wsrep_mode = REQUIRED_PRIMARY_KEY enabled. Table should have
1010
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
1111
DROP TABLE t1;
1212
SET GLOBAL wsrep_mode = default;
13+
SET GLOBAL wsrep_mode = STRICT_REPLICATION;
14+
CREATE VIEW v AS SELECT * FROM JSON_TABLE ('{"a":0}',"$" COLUMNS (a DECIMAL(1,1) path '$.a')) foo;
15+
DROP VIEW v;
16+
SET GLOBAL wsrep_mode = default;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
1515

1616
DROP TABLE t1;
1717
SET GLOBAL wsrep_mode = default;
18+
19+
20+
# MDEV-25698 SIGSEGV in wsrep_should_replicate_ddl
21+
22+
SET GLOBAL wsrep_mode = STRICT_REPLICATION;
23+
CREATE VIEW v AS SELECT * FROM JSON_TABLE ('{"a":0}',"$" COLUMNS (a DECIMAL(1,1) path '$.a')) foo;
24+
DROP VIEW v;
25+
SET GLOBAL wsrep_mode = default;

sql/wsrep_mysqld.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,6 +2229,9 @@ bool wsrep_should_replicate_ddl(THD* thd, const handlerton *hton)
22292229
if (!wsrep_check_mode(WSREP_MODE_STRICT_REPLICATION))
22302230
return true;
22312231

2232+
if (!hton)
2233+
return true;
2234+
22322235
switch (hton->db_type)
22332236
{
22342237
case DB_TYPE_INNODB:

0 commit comments

Comments
 (0)