From: Ole John Aske Date: January 13 2011 12:29pm Subject: bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3404 to 3405) Bug#58818 List-Archive: http://lists.mysql.com/commits/128648 X-Bug: 58818 Message-Id: <20110113122932.353B2223@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 3404 jonas oreland 2011-01-06 [merge] ndb - merge 70-spj-svs modified: sql/ha_ndbcluster.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) No bundle (reason: useless for push emails).