summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2011-01-18 19:15:55 +0200
committerunknown <timour@askmonty.org>2011-01-18 19:15:55 +0200
commit2038256bede201f025cac384a9043627a83afd5d (patch)
treea819a4aa7bf67b6919e596086689f58446e6d1b4
parent5c4e64a574b01a26eb95b6676874060cdbbb6193 (diff)
downloadmariadb-git-2038256bede201f025cac384a9043627a83afd5d.tar.gz
Fix LP BUG#704337
Analysis: The cause for the failing assert was that between preparation and execution of a DELETE prepared statement, the server reverted back all changes of the item tree. Since the substitution of Item_in_subselect by an Item_in_optimizer was recorded via change_item_tree, thus the rollback of the item tree affected the substitution as well. As a result the execution of the PS called Item_in_subselect::val_int(), which was never supposed to be called. Solution: Replace change_item_tree with assignment. This is OK because the Item objects used for substitution are created in PS memory.
-rw-r--r--sql/item_subselect.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 62042380a7e..b30cf450d6d 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -228,9 +228,9 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref)
set correct WHERE/HAVING for PS.
*/
if (unit->outer_select()->where == (*ref))
- thd->change_item_tree(&(unit->outer_select()->where), substitution);
+ unit->outer_select()->where= substitution;
else if (unit->outer_select()->having == (*ref))
- thd->change_item_tree(&(unit->outer_select()->having), substitution);
+ unit->outer_select()->having= substitution;
(*ref)= substitution;
substitution->name= name;