List:Commits« Previous MessageNext Message »
From:Ole John Aske Date:January 13 2011 12:28pm
Subject:bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch
(ole.john.aske:3405) Bug#58818
View as plain text  
#At file:///net/fimafeng09/export/home/tmp/oleja/mysql/mysql-5.1-telco-7.0-spj-scan-scan/ based on revid:jonas@stripped

 3405 Ole John Aske	2011-01-13
      SPJ-scan-scan: Updated fix for bug#58818 
      'Incorrect result for IN/ANY subquery with HAVING condition'
      according to what has been approved and pushed to mysql-5.5 & mysql-trunk.

    modified:
      sql/item_subselect.cc
=== modified file 'sql/item_subselect.cc'
--- a/sql/item_subselect.cc	2010-12-08 15:41:50 +0000
+++ b/sql/item_subselect.cc	2011-01-13 12:28:49 +0000
@@ -1097,16 +1097,6 @@ Item_in_subselect::single_value_transfor
       select_lex->group_list.elements)
   {
     bool tmp;
-    /*
-      If 'having' condition may evaluate to 'unknown', we must ensure
-      it 'IS TRUE' before we are allowed to continue into the AND'ed
-      Item_ref_null_helper object.
-    */
-    Item *having= join->having;
-    if (!abort_on_null && having && having->maybe_null)
-    {
-      having= new Item_func_istrue(having);
-    }
     Item *item= func->create(expr,
                              new Item_ref_null_helper(&select_lex->context,
                                                       this,
@@ -1128,9 +1118,10 @@ Item_in_subselect::single_value_transfor
       we can assign select_lex->having here, and pass 0 as last
       argument (reference) to fix_fields()
     */
-    select_lex->having= join->having= and_items(having, item);
+    select_lex->having= join->having= and_items(join->having, item);
     if (join->having == item)
       item->name= (char*)in_having_cond;
+    select_lex->having->top_level_item();
     select_lex->having_fix_field= 1;
     /*
       we do not check join->having->fixed, because Item_and (from and_items)


Attachment: [text/bzr-bundle] bzr/ole.john.aske@oracle.com-20110113122849-s17rwus4lx4vcxqm.bundle
Thread
bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch(ole.john.aske:3405) Bug#58818Ole John Aske13 Jan