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 List-Archive: http://lists.mysql.com/commits/128647 X-Bug: 58818 Message-Id: <20110113122856.0B405223@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5103566169026291942==" --===============5103566169026291942== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #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) --===============5103566169026291942== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/ole.john.aske@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: ole.john.aske@stripped\ # s17rwus4lx4vcxqm # target_branch: file:///net/fimafeng09/export/home/tmp/oleja/mysql\ # /mysql-5.1-telco-7.0-spj-scan-scan/ # testament_sha1: f4c6edafcf2a2267030b8fc71088bca4e352448f # timestamp: 2011-01-13 13:28:55 +0100 # base_revision_id: jonas@stripped # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWYDySsIAAapfgEAQWef//3Lx yyC////wUAQB7u1Wbpsbq7U6EohNCZMVPGajQyNU8SB6T0hjU0zJBoJSmTJNk0TTaRqPSMnqaBoA NAAAGRNJkm0mCnqaNMgaNGhoAAyABzCYBMAJhMJpgAAEyaaBhJIRoAIaMSNMpk0ejUaaaNBoAaMM unQL5fkWEKyRRtTqZy1UTM6EmiKnEy2cVQYNfk5Wqqh5eIdXPWpWXMKmuFVvfJz6Nw8d7+r/nG+j ++n+a7sm2cITq+NhzUb6R4tjLbbN3nSMUSW+F8Tc+xvyjnGiHVIknom0KsjK+hdGXieHWMhFnwpv 7OD5mSgUJhIioiZ+cWN1kgFc/WcYbzi0qZAwi0jcnkAZOcO4sTgyv0zRbABFBFVozPIEhDRIKWgL hLieQGAQFHM4vqICKrKUe3VexoGz4CT5oox1YFLuARdr38i22UjbLll2DGStk8AVxrNc8rYqLhmF IylZOwTxZzQHZRsma0sWDJmvlRM06tFWKiWvSOnJKsEbGXhNy2+DoZRxGTKWV7CG2ewxOdWCsibT PTWXn73C6xWTx6NY+a0c5fx0xdXpjszMLYpqVfWwqSgc22EEUbpkScuUxzy+LMEjjzLodAZAyC42 Uml4NqCkuZrWBeLLmVsEJp3Ch9tCKJApJEVREPUIIi8OFAfe6EDF87qmR8gFGwge9NFpCYIzN7zk Ydp2XUtbpWzx9WaOCiBDyqrgDHk7i4/fh1b0Ond6q5smWubbWwO1xl5MLEztS5V37/bg9ptLZ+8C z0Frw7NN/eobBzcTlSjVMu4DW9tjODlItBP2UZD9ZDVkSq32Hd0Mn5C1LmImQYLUn2k7Z6c5GYCg 5ZyRhwtCwH9B6gpcl991tdUDW87rmKZLWCjKz8XfeiBpMvGhn4zIadMoFmBgyeYNsvuchbHjfbC1 y1wpZVTyWP0YY8epBRG1DkVO832Pj1Ya6CWEGApIjrDVTbcbiom3d27bIRVGT1v3k+tgYsRAY6Ch UhjfXquRZQxe24KoelBuLgoWNpzjeHmmk2mhOLaS8KZeAeWN8k94NCD89IuNGkxz72fKUaE1gWVZ E280j0CGCVhWQRMwlC5wv9woA2gOIInXRnvJ+AqgiTiHULB8E0JqR80aSzxvdv4ph049dx+pRrY5 ZJOSgKsWomkTmR3akAEZEUHnGaOmqREyFDZHOExXwOuoEXeg5Qi6IgqkSp2fIorawxAeEr03F6ul u6VoIZXMy85SHNHBixzRafkxiYVicnWDpEcuEQrKgFyWMRKnjUQzwNXXeYSVksWhedQnwYrm0i1C eptUAjoXmaOokcW0bgd41AVHubp6WoPyK0qDGlPfR2tvzZOc43GDQpvFbUStwfnuxkUZ9pwoCeNi PsiCvbbrdmlZ2iX/HiJkjoTKDgt0FIDnmAsROUA3ijAlHKT/i7kinChIQHklYQA= --===============5103566169026291942==--