From 879223f1f296d749b8135d23a05e5dd899667975 Mon Sep 17 00:00:00 2001 From: Nikita Malyavin Date: Tue, 21 Jul 2020 13:06:36 +1000 Subject: move fix_vcol_exprs into TABLE --- sql/sql_base.cc | 10 +++++----- sql/table.h | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index cd13985894c..45ce4be3eb5 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5332,18 +5332,18 @@ static void mark_real_tables_as_free_for_reuse(TABLE_LIST *table_list) DBUG_VOID_RETURN; } -static int fix_table_vcol_exprs(THD *thd, TABLE *t) +int TABLE::fix_vcol_exprs(THD *thd) { - for (Field **vf= t->vfield; vf && *vf; vf++) + for (Field **vf= vfield; vf && *vf; vf++) if (fix_session_vcol_expr(thd, (*vf)->vcol_info)) return 1; - for (Field **df= t->default_field; df && *df; df++) + for (Field **df= default_field; df && *df; df++) if ((*df)->default_value && fix_session_vcol_expr(thd, (*df)->default_value)) return 1; - for (Virtual_column_info **cc= t->check_constraints; cc && *cc; cc++) + for (Virtual_column_info **cc= check_constraints; cc && *cc; cc++) if (fix_session_vcol_expr(thd, (*cc))) return 1; @@ -5371,7 +5371,7 @@ static bool fix_all_session_vcol_exprs(THD *thd, TABLE_LIST *tables) if (table->security_ctx) thd->security_ctx= table->security_ctx; - error= fix_table_vcol_exprs(thd, t); + error= t->fix_vcol_exprs(thd); thd->security_ctx= save_security_ctx; thd->stmt_arena= stmt_backup; diff --git a/sql/table.h b/sql/table.h index f719a0d03a2..cef6861f6b5 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1760,6 +1760,8 @@ public: void vers_update_end(); void find_constraint_correlated_indexes(); + int fix_vcol_exprs(THD *thd); + /** Number of additional fields used in versioned tables */ #define VERSIONING_FIELDS 2 }; -- cgit v1.2.1