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

MDEV-33658 1/2 Refactoring: extract Key length initialization

mysql_prepare_create_table: Extract a Key initialization part that
relates to length calculation and long unique index designation.

append_system_key_parts call also moves there.

Move this initialization before the duplicate elimination.

Extract WITHOUT OVERPLAPS check into a separate function. It had to be moved
earlier in the code to preserve the order of the error checks, as in the tests.
This commit is contained in:
Nikita Malyavin
2024-10-12 21:32:18 +02:00
parent e33064e0fc
commit ecaedbe299
10 changed files with 362 additions and 251 deletions

View File

@ -424,6 +424,7 @@ public:
bool invisible;
bool without_overlaps;
bool old;
uint length;
Lex_ident period;
Key(enum Keytype type_par, const LEX_CSTRING *name_arg,
@ -431,7 +432,7 @@ public:
:DDL_options(ddl_options),
type(type_par), key_create_info(default_key_create_info),
name(*name_arg), option_list(NULL), generated(generated_arg),
invisible(false), without_overlaps(false), old(false)
invisible(false), without_overlaps(false), old(false), length(0)
{
key_create_info.algorithm= algorithm_arg;
}
@ -442,7 +443,7 @@ public:
:DDL_options(ddl_options),
type(type_par), key_create_info(*key_info_arg), columns(*cols),
name(*name_arg), option_list(create_opt), generated(generated_arg),
invisible(false), without_overlaps(false), old(false)
invisible(false), without_overlaps(false), old(false), length(0)
{}
Key(const Key &rhs, MEM_ROOT *mem_root);
virtual ~Key() = default;