From: Sergey Glukhov Date: May 16 2011 11:02am Subject: bzr push into mysql-trunk branch (sergey.glukhov:3087 to 3088) Bug#12402590 List-Archive: http://lists.mysql.com/commits/137418 X-Bug: 12402590 Message-Id: <201105161107.p4GB7Iuk029778@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3088 Sergey Glukhov 2011-05-16 Bug#12402590 ASSERT AT PROTOCOL::END_STATEMENT ON MYSQL-TRUNK RUNNING RQG_OPT_SUBQUERY TEST There are two problems: 1. make_cond_for_table() fails to extract sort table condition for ICP The fix is to use (table_map) 0 instead of used_tables in third argument for make_cond_for_table() function. (for more info see bug11756928). 2. when we exit from JOIN::exec due to failed extraction of sort table condition for ICP we do not set proper diagnostic status of Diagnostics_area(should be my_error() call or something similar). There are many places in JOIN::exec (DBUG_VOID_RETURN on error without my_error() call) which could have the same problems. This problem will be fixed separatly. @ mysql-test/r/having.result test case @ mysql-test/t/having.test test case @ sql/sql_select.cc use (table_map) 0 instead of used_tables in third argument for make_cond_for_table() function. (for more info see bug11756928). modified: mysql-test/r/having.result mysql-test/t/having.test sql/sql_select.cc 3087 Andrei Elkin 2011-05-16 Bug 12535301 - SYS_VARS.RPL_INIT_SLAVE_FUNC MISMATCHES IN DAILY-5.5 reverting sys_vars.rpl_init_slave_func back to the regular suites. The test failure is specific to 5.5. modified: mysql-test/collections/default.experimental === modified file 'mysql-test/r/having.result' --- a/mysql-test/r/having.result 2011-04-22 08:05:02 +0000 +++ b/mysql-test/r/having.result 2011-05-16 11:01:28 +0000 @@ -589,3 +589,27 @@ pk field1 1 7 drop table `t1`; End of 5.5 tests +# +# Bug#12402590 ASSERT AT PROTOCOL::END_STATEMENT ON MYSQL-TRUNK +# RUNNING RQG_OPT_SUBQUERY TEST +# +CREATE TABLE t2 ( +f1 INT, +PRIMARY KEY (f1) +); +INSERT INTO t2 VALUES (1), (2); +CREATE TABLE t1 ( +f1 INT, +f2 VARCHAR(1), +f3 VARCHAR(1), +PRIMARY KEY (f1), +KEY (f2, f1) +); +INSERT INTO t1 VALUES (8, 'g', 'g'), (11, 'a', 'a'); +SELECT t1.f1 FROM t1 JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f3 AND t1.f2 IN ('f') +HAVING (1 ,6) IN (SELECT 3, 6) +ORDER BY t1.f1; +f1 +DROP TABLE t1, t2; +End of 5.6 tests === modified file 'mysql-test/t/having.test' --- a/mysql-test/t/having.test 2011-04-22 08:05:02 +0000 +++ b/mysql-test/t/having.test 2011-05-16 11:01:28 +0000 @@ -615,3 +615,31 @@ drop table `t1`; --echo End of 5.5 tests +--echo # +--echo # Bug#12402590 ASSERT AT PROTOCOL::END_STATEMENT ON MYSQL-TRUNK +--echo # RUNNING RQG_OPT_SUBQUERY TEST +--echo # + +CREATE TABLE t2 ( + f1 INT, + PRIMARY KEY (f1) +); +INSERT INTO t2 VALUES (1), (2); + +CREATE TABLE t1 ( + f1 INT, + f2 VARCHAR(1), + f3 VARCHAR(1), + PRIMARY KEY (f1), + KEY (f2, f1) +); +INSERT INTO t1 VALUES (8, 'g', 'g'), (11, 'a', 'a'); + +SELECT t1.f1 FROM t1 JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f3 AND t1.f2 IN ('f') +HAVING (1 ,6) IN (SELECT 3, 6) +ORDER BY t1.f1; + +DROP TABLE t1, t2; + +--echo End of 5.6 tests === modified file 'sql/sql_select.cc' --- a/sql/sql_select.cc 2011-05-06 12:56:36 +0000 +++ b/sql/sql_select.cc 2011-05-16 11:01:28 +0000 @@ -3342,7 +3342,8 @@ JOIN::exec() if (curr_table->pre_idx_push_cond) { sort_table_cond= make_cond_for_table(curr_join->tmp_having, - used_tables, used_tables, 0); + used_tables, + (table_map) 0, 0); if (!sort_table_cond) DBUG_VOID_RETURN; Item* new_pre_idx_push_cond= No bundle (reason: useless for push emails).