summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2010-07-17 11:16:16 -0700
committerIgor Babaev <igor@askmonty.org>2010-07-17 11:16:16 -0700
commit452860dfdead7f47b0312598db95ea09201e9d4e (patch)
tree2d07f602409f379bef6d49947031d5e3ce28e918 /sql/sql_handler.cc
parent683154d1fa6249a8bfcde4bb9227570c452ea802 (diff)
downloadmariadb-git-452860dfdead7f47b0312598db95ea09201e9d4e.tar.gz
Fixed bug #604503.
If the expression for a virtual column of table contained datetime comparison then the execution of the second query that used this virtual column caused a crash. It happened because the execution of the first query that used this virtual column inserted a cached item into the expression tree. The cached tree was allocated in the statement memory while the expression tree was allocated in the table memory. Now the cached items that are inserted into expressions for virtual columns with datetime comparisons are always allocated in the same mem_root as the expressions for virtual columns. So now the inserted cached items are valid for any queries that use these virtual columns.
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 2f3ce99ab9c..61f29886da8 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -664,7 +664,7 @@ retry:
goto ok;
}
/* Generate values for virtual fields */
- update_virtual_fields(table);
+ update_virtual_fields(thd, table);
if (cond && !cond->val_int())
continue;
if (num_rows >= offset_limit_cnt)