From: Ole John Aske Date: January 13 2011 9:20am Subject: bzr commit into mysql-5.5 branch (ole.john.aske:3236) Bug#58134 List-Archive: http://lists.mysql.com/commits/128608 X-Bug: 58134 Message-Id: <20110113092050.16894223@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9216308356872252472==" --===============9216308356872252472== 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.5/ based on revid:georgi.kodinov@stripped 3236 Ole John Aske 2011-01-13 Fix for bug#58134: 'Incorrectly condition pushdown inside subquery to NDB engine' An incorrect 'table_map' containing both the table itself, and possible any outer-refs if this was the last table in the subquery, was presented to make_cond_for_table(). As a pushed condition is only able to refer column from the table the condition is pushed to, nothing else than columns from the table itself (tab->table->map) may be refered in the pushed condition constructed by 'push_cond= make_cond_for_table()'. Also fix a minor 'copy and paste' bug in a comment inside make_cond_for_table(). No testcase is possible on mainbranch as the NDB engine is not available (yet) on mysql >= 5.5 modified: sql/sql_select.cc === modified file 'sql/sql_select.cc' --- a/sql/sql_select.cc 2011-01-12 09:31:41 +0000 +++ b/sql/sql_select.cc 2011-01-13 09:20:45 +0000 @@ -6480,7 +6480,7 @@ make_join_select(JOIN *join,SQL_SELECT * OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN) { COND *push_cond= - make_cond_for_table(tmp, current_map, current_map); + make_cond_for_table(tmp, tab->table->map, tab->table->map); if (push_cond) { /* Push condition to handler */ @@ -13099,7 +13099,7 @@ make_cond_for_table(COND *cond, table_ma new_cond->argument_list()->push_back(fix); } /* - Item_cond_and do not need fix_fields for execution, its parameters + Item_cond_or do not need fix_fields for execution, its parameters are fixed or do not need fix_fields, too */ new_cond->quick_fix_field(); --===============9216308356872252472== 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\ # 88ve30e8uh2bbrlo # target_branch: file:///net/fimafeng09/export/home/tmp/oleja/mysql\ # /mysql-5.5/ # testament_sha1: 6195f0a32109eca67825bfd8be6eedddb4aa92fb # timestamp: 2011-01-13 10:20:49 +0100 # base_revision_id: georgi.kodinov@stripped\ # 5wc47ja8xo9od7ei # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWW4y458AAebfgBAwWOf//3cx gAC////wUAUal3nnvZt220007eTV0Mk1NMlP0mp6Rs1NGImJk0BiBpoAJREDTRpppiiepqZqDRpi AAGgCUIaTRpE9Minp6miZMm1B6jRoeU0NNA2pKeiDSeibQaAGp6mAQYQwmAkkECaeiGo1PNSfo0T aIg0yAGh6kCGidcOjyzbinwz6K0uS+9efHOM1Q4qErcyDvKDTf5kDDHyWCAvObl+y08IZd/UgRBP 6gPkemK1NajUGtWHHmYNzenXgS5aIcu3XyW3lApN3n4DSvnff5WtVZvasSCqvSyNra3r0yzwuelk K6WnUYo9sKQcUoLasYjfpyxsd19XJB8dd12Tn11FiEVzj5joAUoETVFveUxRgoqpEQRmUxmRGWia yqta/i9MHqrSmuxlQKhGCcwXiWhE+28LW8jpmIFwhklBzmFqVw8hyQRYwCCuKyAqYZkpsYEBGUw8 r45Xld0wIc+mmFHtlFBI31rPnN2Wckn29VfaQMr8Yk2D9OUzgjxDWgmdalZ1tmodfMTetZFyBqZC MIGrKWtuck5xxGJ+tKY2EsySjU0o9pucgJza5GjaipSthIWZ5nm2KgW8zO8thAvTJKBfeBvvfhCO GfOF2iky1VJ0ZGYjjRjWiZ0aaDZaUEwww1UcKr0v3wKl/VPrLHXIQgJmjiPRet9qLx50lhUTPfbK GelOeDLMTgI4SiLql6SYxEjHk0d0vHP3zbp3rjjbmmGhdBRS+d0dKM7DEVeCK6yJhOa9/yOnw278 q7JCt3B/beC78LiZzL7hQqBBx+gunx9nl0myUDB6YQKNURP8Z8VE+IVrKIbePkutAUsqGAv0edaR ZJwbNVihwxlHBiuuDTDhURv9FceCJqd0derhIom8p3/Hf9xQWiFrxUhRCAvAV5NwMhrIoPd4CJ3B kBl6bCggJSLJ2ZIkTpDWdROC1udB6GIZmAeMcLijhls1YOZFqWJ9UYkioc7GVOwdHDeY9vXR4QPF WVVJ4OH6HO2vcoQje4QtBVgZCkdh2kcMcRTc8tSUu6IzwsoBtPNybwogT4RhCyV1lrPM9C6E3otu fczebjNtRdSgrnElhYazF1tjFcy/QJ5oBuligYJCtsqWCkbRnXedhp0E5SW5frK1VX97yYGOjFTu UxrIHNEVrUSyfl7GpFwL3sEPBzgKnJxiB4moH70xbfbQNb33KAzpqsyzPYbJJIkCwbINBpv3v2XJ Kzju2RqhgDhbYFIPVTyz+NPxw5q9LuIgaQq3mwJlifdbQoCtwPULdBDgdWiwKSRik8fFFmvhvFD+ ypML3IUdAdt3J5Hpbnwsi1bLN3kTshg4xcy/E6lufLsuQtUuRGYLGmL6MMERBSLMmo9rQWKKndfW BwKToiqD2MKcPklViBsDcHpzQRfJsNJWh8cA/lyTX9k6pJhEhLM4VlnoW6ByhTTyTsLwCtpXigQr U8ZUVnbDEybukNxgkjJVRYE/f2l0je7T4sFlbRLLyJgpewMiA0DIjYd0kJ3bZFEnstEgleOWwe5y wqzrAUh21fjuYK5VF4jdn284JaWbcFKWtDAyHhZB6JiaFcrZ1dS/i9WY04ll0BeYIeoZtUXLpykk m7jxoGa7B4JyvemGLe7jSD0pFiQUVRi/LVvTsLuD4TcGoRBpp2HplPA2RxNx9BYaSfci2z3yHrTS J65HaFpI8E+A6aXORU1jpmzaChKzvK+kbkPkdB/xdyRThQkG4y458A== --===============9216308356872252472==--