mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-25549 : Assertion `*new_engine' failed in bool check_engine(THD*, const char*, const char*, HA_CREATE_INFO*)
In Galera case we call check_engine that could set create_info->db_type to NULL e.g. if TEMPORARY is not supported by storage engine. Thus, we need to restore it after that call because it is needed later on mysql_create_table that will also call check_engine.
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2000, 2019, Oracle and/or its affiliates.
|
Copyright (c) 2000, 2019, Oracle and/or its affiliates.
|
||||||
Copyright (c) 2010, 2020, MariaDB
|
Copyright (c) 2010, 2022, MariaDB
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -11036,14 +11036,23 @@ bool Sql_cmd_create_table::execute(THD *thd)
|
|||||||
tables, like mysql replication does. Also check if the requested
|
tables, like mysql replication does. Also check if the requested
|
||||||
engine is allowed/supported.
|
engine is allowed/supported.
|
||||||
*/
|
*/
|
||||||
if (WSREP(thd) &&
|
#ifdef WITH_WSREP
|
||||||
!check_engine(thd, create_table->db, create_table->table_name,
|
if (WSREP(thd))
|
||||||
&create_info) &&
|
|
||||||
(!thd->is_current_stmt_binlog_format_row() ||
|
|
||||||
!create_info.tmp_table()))
|
|
||||||
{
|
{
|
||||||
WSREP_TO_ISOLATION_BEGIN(create_table->db, create_table->table_name, NULL)
|
handlerton *orig_ht= create_info.db_type;
|
||||||
|
if (!check_engine(thd, create_table->db, create_table->table_name,
|
||||||
|
&create_info) &&
|
||||||
|
(!thd->is_current_stmt_binlog_format_row() ||
|
||||||
|
!create_info.tmp_table()))
|
||||||
|
{
|
||||||
|
WSREP_TO_ISOLATION_BEGIN(create_table->db, create_table->table_name, NULL)
|
||||||
|
}
|
||||||
|
// check_engine will set db_type to NULL if e.g. TEMPORARY is
|
||||||
|
// not supported by the storage engine, this case is checked
|
||||||
|
// again in mysql_create_table
|
||||||
|
create_info.db_type= orig_ht;
|
||||||
}
|
}
|
||||||
|
#endif /* WITH_WSREP */
|
||||||
/* Regular CREATE TABLE */
|
/* Regular CREATE TABLE */
|
||||||
res= mysql_create_table(thd, create_table, &create_info, &alter_info);
|
res= mysql_create_table(thd, create_table, &create_info, &alter_info);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user