mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-25292 Refactoring: moved select_field_count into Alter_info.
There is a need in MDEV-25292 to have both C_ALTER_TABLE and select_field_count in one call. Semantically creation mode and field count are two different things. Making creation mode negative constants and field count positive variable into one parameter seems to be a lazy hack for not making the second parameter. select_count does not make sense without alter_info->create_list, so the natural way is to hold it in Alter_info too. select_count is now stored in member select_field_count.
This commit is contained in:
@ -4490,7 +4490,7 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
|
||||
TABLE tmp_table; // Used during 'Create_field()'
|
||||
TABLE_SHARE share;
|
||||
TABLE *table= 0;
|
||||
uint select_field_count= items->elements;
|
||||
alter_info->select_field_count= items->elements;
|
||||
/* Add selected items to field list */
|
||||
List_iterator_fast<Item> it(*items);
|
||||
Item *item;
|
||||
@ -4550,8 +4550,7 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
|
||||
|
||||
if (create_info->check_fields(thd, alter_info,
|
||||
create_table->table_name,
|
||||
create_table->db,
|
||||
select_field_count))
|
||||
create_table->db))
|
||||
DBUG_RETURN(NULL);
|
||||
|
||||
DEBUG_SYNC(thd,"create_table_select_before_create");
|
||||
@ -4587,7 +4586,7 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
|
||||
&create_table->db,
|
||||
&create_table->table_name,
|
||||
create_info, alter_info, NULL,
|
||||
select_field_count, create_table))
|
||||
C_ORDINARY_CREATE, create_table))
|
||||
{
|
||||
DEBUG_SYNC(thd,"create_table_select_before_open");
|
||||
|
||||
|
Reference in New Issue
Block a user