Commit 5282d0dc authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: use enum, not uint, for enum variables

parent d717fe76
...@@ -362,11 +362,13 @@ class Foreign_key: public Key { ...@@ -362,11 +362,13 @@ class Foreign_key: public Key {
LEX_CSTRING ref_db; LEX_CSTRING ref_db;
LEX_CSTRING ref_table; LEX_CSTRING ref_table;
List<Key_part_spec> ref_columns; List<Key_part_spec> ref_columns;
uint delete_opt, update_opt, match_opt; enum enum_fk_option delete_opt, update_opt;
enum fk_match_opt match_opt;
Foreign_key(const LEX_CSTRING *name_arg, List<Key_part_spec> *cols, Foreign_key(const LEX_CSTRING *name_arg, List<Key_part_spec> *cols,
const LEX_CSTRING *ref_db_arg, const LEX_CSTRING *ref_table_arg, const LEX_CSTRING *ref_db_arg, const LEX_CSTRING *ref_table_arg,
List<Key_part_spec> *ref_cols, List<Key_part_spec> *ref_cols,
uint delete_opt_arg, uint update_opt_arg, uint match_opt_arg, enum_fk_option delete_opt_arg, enum_fk_option update_opt_arg,
fk_match_opt match_opt_arg,
DDL_options ddl_options) DDL_options ddl_options)
:Key(FOREIGN_KEY, name_arg, &default_key_create_info, 0, cols, NULL, :Key(FOREIGN_KEY, name_arg, &default_key_create_info, 0, cols, NULL,
ddl_options), ddl_options),
......
...@@ -1383,7 +1383,6 @@ innobase_set_foreign_key_option( ...@@ -1383,7 +1383,6 @@ innobase_set_foreign_key_option(
ut_ad(!foreign->type); ut_ad(!foreign->type);
switch (fk_key->delete_opt) { switch (fk_key->delete_opt) {
// JAN: TODO: ? MySQL 5.7 used enum fk_option directly from sql_lex.h
case FK_OPTION_NO_ACTION: case FK_OPTION_NO_ACTION:
case FK_OPTION_RESTRICT: case FK_OPTION_RESTRICT:
case FK_OPTION_SET_DEFAULT: case FK_OPTION_SET_DEFAULT:
...@@ -1395,6 +1394,8 @@ innobase_set_foreign_key_option( ...@@ -1395,6 +1394,8 @@ innobase_set_foreign_key_option(
case FK_OPTION_SET_NULL: case FK_OPTION_SET_NULL:
foreign->type = DICT_FOREIGN_ON_DELETE_SET_NULL; foreign->type = DICT_FOREIGN_ON_DELETE_SET_NULL;
break; break;
case FK_OPTION_UNDEF:
DBUG_ASSERT(0);
} }
switch (fk_key->update_opt) { switch (fk_key->update_opt) {
...@@ -1409,6 +1410,8 @@ innobase_set_foreign_key_option( ...@@ -1409,6 +1410,8 @@ innobase_set_foreign_key_option(
case FK_OPTION_SET_NULL: case FK_OPTION_SET_NULL:
foreign->type |= DICT_FOREIGN_ON_UPDATE_SET_NULL; foreign->type |= DICT_FOREIGN_ON_UPDATE_SET_NULL;
break; break;
case FK_OPTION_UNDEF:
DBUG_ASSERT(0);
} }
return(innobase_check_fk_option(foreign)); return(innobase_check_fk_option(foreign));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment