mirror of
https://github.com/MariaDB/server.git
synced 2026-05-04 22:25:32 +02:00
MDEV-35144 CREATE TABLE ... LIKE uses current innodb_compression_default instead of the create value
When adding a column or index that uses plugin-defined sysvar-based options with CREATE ... LIKE the server was using the current value of the sysvar, not the default one. Because parse_option_list() function was used both in create and open and it tried to guess when it's create (need to use current sysvar value and add a new name=value pair to the list) or open (need to use default, without extending the list). Let's move the list extending functionality into a separate function and call it explicitly when needed. Operations that add new objects (CREATE, ALTER ... ADD) will extend the list, other operations (ALTER, CREATE ... LIKE, open) will not.
This commit is contained in:
parent
600c42ea86
commit
3da565c41d
9 changed files with 184 additions and 77 deletions
|
|
@ -3767,7 +3767,11 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
|||
sql_field->offset= record_offset;
|
||||
if (MTYP_TYPENR(sql_field->unireg_check) == Field::NEXT_NUMBER)
|
||||
auto_increment++;
|
||||
if (parse_option_list(thd, create_info->db_type, &sql_field->option_struct,
|
||||
extend_option_list(thd, create_info->db_type, !sql_field->field,
|
||||
&sql_field->option_list,
|
||||
create_info->db_type->field_options,
|
||||
thd->stmt_arena->mem_root);
|
||||
if (parse_option_list(thd, &sql_field->option_struct,
|
||||
&sql_field->option_list,
|
||||
create_info->db_type->field_options, FALSE,
|
||||
thd->mem_root))
|
||||
|
|
@ -4034,7 +4038,10 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
|||
key_info->usable_key_parts= key_number;
|
||||
key_info->algorithm= key->key_create_info.algorithm;
|
||||
key_info->option_list= key->option_list;
|
||||
if (parse_option_list(thd, create_info->db_type, &key_info->option_struct,
|
||||
extend_option_list(thd, create_info->db_type, !key->old,
|
||||
&key_info->option_list, create_info->db_type->index_options,
|
||||
thd->stmt_arena->mem_root);
|
||||
if (parse_option_list(thd, &key_info->option_struct,
|
||||
&key_info->option_list,
|
||||
create_info->db_type->index_options, FALSE,
|
||||
thd->mem_root))
|
||||
|
|
@ -4624,10 +4631,13 @@ without_overlaps_err:
|
|||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_UNKNOWN_OPTION,
|
||||
ER_THD(thd, ER_UNKNOWN_OPTION), "transactional");
|
||||
|
||||
if (parse_option_list(thd, file->partition_ht(), &create_info->option_struct,
|
||||
&create_info->option_list,
|
||||
file->partition_ht()->table_options, FALSE,
|
||||
thd->mem_root))
|
||||
extend_option_list(thd, file->partition_ht(),
|
||||
!thd->lex->create_like() && create_table_mode > C_ALTER_TABLE,
|
||||
&create_info->option_list, file->partition_ht()->table_options,
|
||||
thd->stmt_arena->mem_root);
|
||||
if (parse_option_list(thd, &create_info->option_struct,
|
||||
&create_info->option_list,
|
||||
file->partition_ht()->table_options, FALSE, thd->mem_root))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
DBUG_EXECUTE_IF("key",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue