1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge branch '10.2' into 10.3

This commit is contained in:
Oleksandr Byelkin
2022-01-29 15:41:05 +01:00
354 changed files with 3955 additions and 1103 deletions

View File

@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2019, Oracle and/or its affiliates.
Copyright (c) 2010, 2021, MariaDB
Copyright (c) 2010, 2022, MariaDB
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
@ -5763,8 +5763,15 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
#ifdef WITH_PARTITION_STORAGE_ENGINE
/* Partition info is not handled by mysql_prepare_alter_table() call. */
if (src_table->table->part_info)
thd->work_part_info= src_table->table->part_info->get_clone(thd);
#endif
{
/*
The CREATE TABLE LIKE should not inherit the DATA DIRECTORY
and INDEX DIRECTORY from the base table.
So that TRUE argument for the get_clone.
*/
thd->work_part_info= src_table->table->part_info->get_clone(thd, TRUE);
}
#endif /*WITH_PARTITION_STORAGE_ENGINE*/
/*
Adjust description of source table before using it for creation of
@ -11408,14 +11415,25 @@ bool Sql_cmd_create_table_like::execute(THD *thd)
tables, like mysql replication does. Also check if the requested
engine is allowed/supported.
*/
if (WSREP(thd) &&
!check_engine(thd, create_table->db.str, create_table->table_name.str,
&create_info) &&
(!thd->is_current_stmt_binlog_format_row() ||
!create_info.tmp_table()))
#ifdef WITH_WSREP
if (WSREP(thd))
{
WSREP_TO_ISOLATION_BEGIN(create_table->db.str, create_table->table_name.str, NULL)
handlerton *orig_ht= create_info.db_type;
if (!check_engine(thd, create_table->db.str,
create_table->table_name.str,
&create_info) &&
(!thd->is_current_stmt_binlog_format_row() ||
!create_info.tmp_table()))
{
WSREP_TO_ISOLATION_BEGIN(create_table->db.str,
create_table->table_name.str, 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 */
res= mysql_create_table(thd, create_table, &create_info, &alter_info);
}