#At file:///home/gluh/MySQL/mysql-trunk/ based on revid:andrei.elkin@stripped
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
=== 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=
Attachment: [text/bzr-bundle] bzr/sergey.glukhov@oracle.com-20110516110128-pt8eq343xtfdhiez.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk branch (sergey.glukhov:3088) Bug#12402590 | Sergey Glukhov | 16 May |