Commit 2f6d464f authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: reorder enum_fk_option

parent f7a9f446
...@@ -9771,20 +9771,14 @@ LEX_CSTRING *fk_option_name(enum_fk_option opt) ...@@ -9771,20 +9771,14 @@ LEX_CSTRING *fk_option_name(enum_fk_option opt)
{ {
{ STRING_WITH_LEN("???") }, { STRING_WITH_LEN("???") },
{ STRING_WITH_LEN("RESTRICT") }, { STRING_WITH_LEN("RESTRICT") },
{ STRING_WITH_LEN("NO ACTION") },
{ STRING_WITH_LEN("CASCADE") }, { STRING_WITH_LEN("CASCADE") },
{ STRING_WITH_LEN("SET NULL") }, { STRING_WITH_LEN("SET NULL") },
{ STRING_WITH_LEN("NO ACTION") },
{ STRING_WITH_LEN("SET DEFAULT") } { STRING_WITH_LEN("SET DEFAULT") }
}; };
return names + opt; return names + opt;
} }
bool fk_modifies_child(enum_fk_option opt)
{
static bool can_write[]= { false, false, true, true, false, true };
return can_write[opt];
}
enum TR_table::enabled TR_table::use_transaction_registry= TR_table::MAYBE; enum TR_table::enabled TR_table::use_transaction_registry= TR_table::MAYBE;
TR_table::TR_table(THD* _thd, bool rw) : TR_table::TR_table(THD* _thd, bool rw) :
......
...@@ -1860,8 +1860,8 @@ enum enum_schema_table_state ...@@ -1860,8 +1860,8 @@ enum enum_schema_table_state
PROCESSED_BY_JOIN_EXEC PROCESSED_BY_JOIN_EXEC
}; };
enum enum_fk_option { FK_OPTION_UNDEF, FK_OPTION_RESTRICT, FK_OPTION_CASCADE, enum enum_fk_option { FK_OPTION_UNDEF, FK_OPTION_RESTRICT, FK_OPTION_NO_ACTION,
FK_OPTION_SET_NULL, FK_OPTION_NO_ACTION, FK_OPTION_SET_DEFAULT}; FK_OPTION_CASCADE, FK_OPTION_SET_NULL, FK_OPTION_SET_DEFAULT };
typedef struct st_foreign_key_info typedef struct st_foreign_key_info
{ {
...@@ -1878,7 +1878,11 @@ typedef struct st_foreign_key_info ...@@ -1878,7 +1878,11 @@ typedef struct st_foreign_key_info
} FOREIGN_KEY_INFO; } FOREIGN_KEY_INFO;
LEX_CSTRING *fk_option_name(enum_fk_option opt); LEX_CSTRING *fk_option_name(enum_fk_option opt);
bool fk_modifies_child(enum_fk_option opt); static inline bool fk_modifies_child(enum_fk_option opt)
{
return opt >= FK_OPTION_CASCADE;
}
class IS_table_read_plan; class IS_table_read_plan;
......
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