summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2021-02-12 20:40:25 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2021-02-12 20:43:03 +0200
commitb3df194e31eb2e76a319d8d4195163df596447a6 (patch)
tree0f4f9b42f61ad58ee5240cdd70a829305f3c6001 /sql/wsrep_mysqld.cc
parent7fb528d7226819063046c6a70a21511b3620e844 (diff)
downloadmariadb-git-b3df194e31eb2e76a319d8d4195163df596447a6.tar.gz
MDEV-24833 : Signal 11 on wsrep_can_run_in_toi at wsrep_mysqld.cc:1994
Problem was that when engine substitution is allowd (e.g. sql_mode='') we must also check db_type. Additionally, we did not resolve default storage engine on that case and used that to check is TOI possible or not.
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r--sql/wsrep_mysqld.cc22
1 files changed, 18 insertions, 4 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 8118822d595..fc3841dd6d1 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -32,6 +32,7 @@
#include "sp_head.h"
#include "sql_show.h"
#include "sp.h"
+#include "handler.h"
#include "wsrep_priv.h"
#include "wsrep_thd.h"
#include "wsrep_sst.h"
@@ -1991,10 +1992,23 @@ bool wsrep_can_run_in_toi(THD *thd, const char *db, const char *table,
return true;
break;
case SQLCOM_ALTER_TABLE:
- if (create_info &&
- !wsrep_should_replicate_ddl(thd, create_info->db_type->db_type))
- return false;
- /* fallthrough */
+ {
+ if (create_info)
+ {
+ enum legacy_db_type db_type;
+
+ if (create_info->db_type)
+ db_type= create_info->db_type->db_type;
+ else
+ {
+ const handlerton *hton= ha_default_handlerton(thd);
+ db_type= hton->db_type;
+ }
+ if (!wsrep_should_replicate_ddl(thd, db_type))
+ return false;
+ }
+ }
+ /* fallthrough */
default:
if (table && !thd->find_temporary_table(db, table))
{