1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-25917 create table like fails if source table is partitioned and engine is myisam or aria with data directory.

Create table like removes data_file_path/index_file_path from the
thd->work_partition_info.
This commit is contained in:
Alexey Botchkov
2022-01-22 06:59:40 +04:00
parent ebc77c6d17
commit 50e66db018
6 changed files with 170 additions and 9 deletions

View File

@ -5547,8 +5547,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