|
1 | 1 | /*
|
2 | 2 | Copyright (c) 2000, 2019, Oracle and/or its affiliates.
|
3 |
| - Copyright (c) 2010, 2020, MariaDB |
| 3 | + Copyright (c) 2010, 2022, MariaDB |
4 | 4 |
|
5 | 5 | This program is free software; you can redistribute it and/or modify
|
6 | 6 | 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)
|
11036 | 11036 | tables, like mysql replication does. Also check if the requested
|
11037 | 11037 | engine is allowed/supported.
|
11038 | 11038 | */
|
11039 |
| - if (WSREP(thd) && |
11040 |
| - !check_engine(thd, create_table->db, create_table->table_name, |
11041 |
| - &create_info) && |
11042 |
| - (!thd->is_current_stmt_binlog_format_row() || |
11043 |
| - !create_info.tmp_table())) |
| 11039 | +#ifdef WITH_WSREP |
| 11040 | + if (WSREP(thd)) |
11044 | 11041 | {
|
11045 |
| - WSREP_TO_ISOLATION_BEGIN(create_table->db, create_table->table_name, NULL) |
| 11042 | + handlerton *orig_ht= create_info.db_type; |
| 11043 | + if (!check_engine(thd, create_table->db, create_table->table_name, |
| 11044 | + &create_info) && |
| 11045 | + (!thd->is_current_stmt_binlog_format_row() || |
| 11046 | + !create_info.tmp_table())) |
| 11047 | + { |
| 11048 | + WSREP_TO_ISOLATION_BEGIN(create_table->db, create_table->table_name, NULL) |
| 11049 | + } |
| 11050 | + // check_engine will set db_type to NULL if e.g. TEMPORARY is |
| 11051 | + // not supported by the storage engine, this case is checked |
| 11052 | + // again in mysql_create_table |
| 11053 | + create_info.db_type= orig_ht; |
11046 | 11054 | }
|
| 11055 | +#endif /* WITH_WSREP */ |
11047 | 11056 | /* Regular CREATE TABLE */
|
11048 | 11057 | res= mysql_create_table(thd, create_table, &create_info, &alter_info);
|
11049 | 11058 | }
|
|
0 commit comments