summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/sql/table.h b/sql/table.h
index 9ce4786d2eb..d974c359da2 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1257,6 +1257,7 @@ struct st_cond_statistic;
class SplM_opt_info;
struct vers_select_conds_t;
+struct FOREIGN_KEY;
struct TABLE
{
@@ -1318,6 +1319,9 @@ public:
Field *found_next_number_field; /* Set on open */
Virtual_column_info **check_constraints;
+ st_::span<FOREIGN_KEY> foreign;
+ st_::span<FOREIGN_KEY> referenced;
+
/* Table's triggers, 0 if there are no of them */
Table_triggers_list *triggers;
TABLE_LIST *pos_in_table_list;/* Element referring to this table */
@@ -1845,7 +1849,8 @@ enum enum_schema_table_state
};
enum enum_fk_option { FK_OPTION_UNDEF= 0, FK_OPTION_RESTRICT, FK_OPTION_CASCADE,
- FK_OPTION_SET_NULL, FK_OPTION_NO_ACTION, FK_OPTION_SET_DEFAULT};
+ FK_OPTION_SET_NULL, FK_OPTION_NO_ACTION, FK_OPTION_SET_DEFAULT,
+ FK_OPTION_LAST= FK_OPTION_SET_DEFAULT};
enum fk_match_opt { FK_MATCH_UNDEF, FK_MATCH_FULL,
FK_MATCH_PARTIAL, FK_MATCH_SIMPLE};
@@ -1876,6 +1881,8 @@ public:
Lex_cstring referenced_table;
st_::span<Lex_cstring> foreign_fields;
st_::span<Lex_cstring> referenced_fields;
+ Lex_cstring period;
+ Lex_cstring ref_period;
enum_fk_option update_method;
enum_fk_option delete_method;
@@ -1933,6 +1940,18 @@ typedef class FK_info FOREIGN_KEY_INFO;
LEX_CSTRING *fk_option_name(enum_fk_option opt);
bool fk_modifies_child(enum_fk_option opt);
+struct FOREIGN_KEY
+{
+ uint foreign_key_nr;
+ uint referenced_key_nr;
+ KEY *foreign_key;
+ KEY *referenced_key;
+ uint fields_num;
+ bool has_period;
+ enum_fk_option update_method;
+ enum_fk_option delete_method;
+};
+
class IS_table_read_plan;
/*
@@ -2697,7 +2716,7 @@ struct TABLE_LIST
}
void print(THD *thd, table_map eliminated_tables, String *str,
enum_query_type query_type);
- bool check_single_table(TABLE_LIST **table, table_map map,
+ bool check_single_table(TABLE_LIST **table, table_map map_arg,
TABLE_LIST *view);
bool set_insert_values(MEM_ROOT *mem_root);
void hide_view_error(THD *thd);