1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +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.

Merged and updated by: Monty
This commit is contained in:
Aleksey Midenkov
2022-08-31 11:55:02 +03:00
committed by Monty
parent f8ba5ced55
commit 1f85eeeb53
7 changed files with 24 additions and 25 deletions

View File

@@ -98,6 +98,7 @@ public:
List<Alter_rename_key> alter_rename_key_list;
// List of columns, used by both CREATE and ALTER TABLE.
List<Create_field> create_list;
uint select_field_count;
// Indexes whose ignorability needs to be changed.
List<Alter_index_ignorability> alter_index_ignorability_list;
List<Virtual_column_info> check_constraint_list;
@@ -198,6 +199,7 @@ public:
Alter_info() :
select_field_count(0),
flags(0), partition_flags(0),
keys_onoff(LEAVE_AS_IS),
original_table(0),
@@ -219,6 +221,7 @@ public:
drop_stat_indexes.empty();
rename_stat_fields.empty();
rename_stat_indexes.empty();
select_field_count= 0;
flags= 0;
partition_flags= 0;
keys_onoff= LEAVE_AS_IS;
@@ -328,6 +331,11 @@ public:
bool add_alter_list(THD *thd, LEX_CSTRING name, LEX_CSTRING new_name,
bool exists);
uint field_count() const
{
return create_list.elements - select_field_count;
}
private:
Alter_info &operator=(const Alter_info &rhs); // not implemented
Alter_info(const Alter_info &rhs); // not implemented