diff options
author | Igor Babaev <igor@askmonty.org> | 2010-07-17 11:16:16 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2010-07-17 11:16:16 -0700 |
commit | 452860dfdead7f47b0312598db95ea09201e9d4e (patch) | |
tree | 2d07f602409f379bef6d49947031d5e3ce28e918 /sql/records.cc | |
parent | 683154d1fa6249a8bfcde4bb9227570c452ea802 (diff) | |
download | mariadb-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/records.cc')
-rw-r--r-- | sql/records.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/records.cc b/sql/records.cc index e2a1ea9b4af..b4552a3c450 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -327,7 +327,7 @@ static int rr_quick(READ_RECORD *info) break; } } - update_virtual_fields(info->table); + update_virtual_fields(info->thd, info->table); return tmp; } @@ -396,7 +396,7 @@ int rr_sequential(READ_RECORD *info) } } if (!tmp) - update_virtual_fields(info->table); + update_virtual_fields(info->thd, info->table); return tmp; } |