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

create a reusable function that tells what FK actions can write

and few indentation changes
This commit is contained in:
Sergei Golubchik
2018-02-23 13:41:46 +01:00
parent 17f8e0ecdf
commit 794f71cbc4
5 changed files with 21 additions and 19 deletions

View File

@ -3656,9 +3656,9 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
if (key->type == Key::FOREIGN_KEY)
{
fk_key_count++;
if (((Foreign_key *)key)->validate(alter_info->create_list))
DBUG_RETURN(TRUE);
Foreign_key *fk_key= (Foreign_key*) key;
if (fk_key->validate(alter_info->create_list))
DBUG_RETURN(TRUE);
if (fk_key->ref_columns.elements &&
fk_key->ref_columns.elements != fk_key->columns.elements)
{
@ -4455,12 +4455,8 @@ bool Column_definition::sp_prepare_create_field(THD *thd, MEM_ROOT *mem_root)
}
static bool
vers_prepare_keys(THD *thd,
HA_CREATE_INFO *create_info,
Alter_info *alter_info,
KEY **key_info,
uint key_count)
static bool vers_prepare_keys(THD *thd, HA_CREATE_INFO *create_info,
Alter_info *alter_info, KEY **key_info, uint key_count)
{
DBUG_ASSERT(create_info->versioned());