summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 0e616bea6ef..50d331c49b3 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -2395,6 +2395,7 @@ bool unpack_vcol_info_from_frm(THD *thd,
Query_arena *backup_stmt_arena_ptr;
Query_arena backup_arena;
Query_arena *vcol_arena= 0;
+ Create_field vcol_storage; // placeholder for vcol_info
Parser_state parser_state;
LEX *old_lex= thd->lex;
LEX lex;
@@ -2458,7 +2459,8 @@ bool unpack_vcol_info_from_frm(THD *thd,
if (init_lex_with_single_table(thd, table, &lex))
goto err;
- thd->lex->parse_vcol_expr= TRUE;
+ lex.parse_vcol_expr= TRUE;
+ lex.last_field= &vcol_storage;
/*
Step 3: Use the parser to build an Item object from vcol_expr_str.
@@ -2468,7 +2470,7 @@ bool unpack_vcol_info_from_frm(THD *thd,
goto err;
}
/* From now on use vcol_info generated by the parser. */
- field->vcol_info= thd->lex->vcol_info;
+ field->vcol_info= vcol_storage.vcol_info;
/* Validate the Item tree. */
if (fix_vcol_expr(thd, table, field))