[Commits] Rev 2880: Fix LP BUG#704337 in file:///home/tsk/mprog/src/5.3-mwl89/

timour at askmonty.org timour at askmonty.org
Tue Jan 18 19:17:18 EET 2011


At file:///home/tsk/mprog/src/5.3-mwl89/

------------------------------------------------------------
revno: 2880
revision-id: timour at askmonty.org-20110118171555-xglvrq7nnwp71ua3
parent: timour at askmonty.org-20110117225341-0mm693mic2thb25o
committer: timour at askmonty.org
branch nick: 5.3-mwl89
timestamp: Tue 2011-01-18 19:15:55 +0200
message:
  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.
-------------- next part --------------
=== modified file 'sql/item_subselect.cc'
--- a/sql/item_subselect.cc	2011-01-11 12:04:08 +0000
+++ b/sql/item_subselect.cc	2011-01-18 17:15:55 +0000
@@ -228,9 +228,9 @@ bool Item_subselect::fix_fields(THD *thd
         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;



More information about the commits mailing list