summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-08-18 19:58:51 -0700
committerIgor Babaev <igor@askmonty.org>2013-08-18 19:58:51 -0700
commit4eddb2c221d086d7181ef7ff78bb0e6ce6f3359a (patch)
treed1b3c7ebc6b5149a4111176c53ce112a7585ae21 /sql/table.cc
parentb59738a598569ace75be5e63b7ed6ca69afe6ebc (diff)
parent25c152018dceae35bf0d45de46a33a214048128c (diff)
downloadmariadb-git-4eddb2c221d086d7181ef7ff78bb0e6ce6f3359a.tar.gz
Merge 5.3->5.5.
In particular: Merged the patch for bug mdev-4418 from 5.3 into 5.5. Fixed a bug in the patch that should be backported to 5.3.
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 7635e03ad6b..5bc63fb02c3 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -2070,7 +2070,7 @@ bool fix_vcol_expr(THD *thd,
Item* func_expr= vcol_info->expr_item;
bool result= TRUE;
TABLE_LIST tables;
- int error;
+ int error= 0;
const char *save_where;
Field **ptr, *field;
enum_mark_columns save_mark_used_columns= thd->mark_used_columns;
@@ -2083,7 +2083,11 @@ bool fix_vcol_expr(THD *thd,
thd->where= "virtual column function";
/* Fix fields referenced to by the virtual column function */
- error= func_expr->fix_fields(thd, (Item**)0);
+ if (!func_expr->fixed)
+ error= func_expr->fix_fields(thd, &vcol_info->expr_item);
+ /* fix_fields could change the expression */
+ func_expr= vcol_info->expr_item;
+ /* Number of columns will be checked later */
if (unlikely(error))
{