3439 Olav Sandstaa 2011-09-06
Bug#12724899 - SELECT STRAIGHT_JOIN QUERY GIVES 2 DATES VERSUS
2 WARNINGS WITH ICP ON
This bug is fixed by the fixes for bug 12601961 and bug 12822678.
This patch contains the following changes:
1. Enables the test case for bug 12601961 to run also for MyISAM.
2. One of the two issues causing wrong results for MyISAM was that
MyISAM did not evaluate index conditions when they were pushed on
a table with "const" join type. This problem is fixed by the patch
for bug 12822678 by no longer pushing index conditions for "const"
tables. To detect if future server changes calls ha_index_read_idx_map()
on MyISAM with a pushed index condition, two asserts are added to
ha_myisam::index_read_idx_map().
@ mysql-test/include/icp_tests.inc
Enable the test case for Bug 12822678 to be run also for MyISAM.
@ mysql-test/r/innodb_icp.result
Adding comment to test.
@ mysql-test/r/innodb_icp_none.result
Adding comment to test.
@ mysql-test/r/myisam_icp.result
Test case for Bug#12724899 SELECT STRAIGHT_JOIN QUERY GIVES 2 DATES VERSUS
2 WARNINGS WITH ICP ON.
@ mysql-test/r/myisam_icp_none.result
Test case for Bug#12724899 SELECT STRAIGHT_JOIN QUERY GIVES 2 DATES VERSUS
2 WARNINGS WITH ICP ON.
@ storage/myisam/ha_myisam.cc
Add asserts to ha_myisam::index_read_idx_map() to detect if it is called
when an index condition has been pushed.
modified:
mysql-test/include/icp_tests.inc
mysql-test/r/innodb_icp.result
mysql-test/r/innodb_icp_none.result
mysql-test/r/myisam_icp.result
mysql-test/r/myisam_icp_none.result
storage/myisam/ha_myisam.cc
3438 Tor Didriksen 2011-09-06
Add some error reporting if download of google test fails.
modified:
unittest/gunit/CMakeLists.txt
=== modified file 'mysql-test/include/icp_tests.inc'
--- a/mysql-test/include/icp_tests.inc 2011-09-01 08:38:18 +0000
+++ b/mysql-test/include/icp_tests.inc 2011-09-06 12:45:57 +0000
@@ -967,17 +967,10 @@ DROP TABLE t1;
--echo #
--echo # BUG#12601961 "SEGFAULT IN HANDLER::COMPARE_KEY2"
+--echo # BUG#12724899 "SELECT STRAIGHT_JOIN QUERY GIVES 2 DATES VERSUS
+--echo # 2 WARNINGS WITH ICP ON"
--echo #
-# Note: Until Bug#12724899 is fixed this test should only run
-# with InnoDB as storage engine since the query produces
-# wrong result when using MyISAM.
-
-let $se= `select @@default_storage_engine`;
-
-if ($se == 'InnoDB' )
-{
-
CREATE TABLE t1 (
pk INTEGER NOT NULL,
i1 INTEGER NOT NULL,
@@ -998,8 +991,6 @@ eval $query;
DROP TABLE t1;
-}
-
--echo #
--echo # BUG#12822678 - 2 MORE ROWS WHEN ICP=ON W/ STRAIGHT_JOIN
--echo #
=== modified file 'mysql-test/r/innodb_icp.result'
--- a/mysql-test/r/innodb_icp.result 2011-09-01 08:38:18 +0000
+++ b/mysql-test/r/innodb_icp.result 2011-09-06 12:45:57 +0000
@@ -914,6 +914,8 @@ DROP VIEW v1;
DROP TABLE t1;
#
# BUG#12601961 "SEGFAULT IN HANDLER::COMPARE_KEY2"
+# BUG#12724899 "SELECT STRAIGHT_JOIN QUERY GIVES 2 DATES VERSUS
+# 2 WARNINGS WITH ICP ON"
#
CREATE TABLE t1 (
pk INTEGER NOT NULL,
=== modified file 'mysql-test/r/innodb_icp_none.result'
--- a/mysql-test/r/innodb_icp_none.result 2011-09-01 08:38:18 +0000
+++ b/mysql-test/r/innodb_icp_none.result 2011-09-06 12:45:57 +0000
@@ -913,6 +913,8 @@ DROP VIEW v1;
DROP TABLE t1;
#
# BUG#12601961 "SEGFAULT IN HANDLER::COMPARE_KEY2"
+# BUG#12724899 "SELECT STRAIGHT_JOIN QUERY GIVES 2 DATES VERSUS
+# 2 WARNINGS WITH ICP ON"
#
CREATE TABLE t1 (
pk INTEGER NOT NULL,
=== modified file 'mysql-test/r/myisam_icp.result'
--- a/mysql-test/r/myisam_icp.result 2011-09-01 08:38:18 +0000
+++ b/mysql-test/r/myisam_icp.result 2011-09-06 12:45:57 +0000
@@ -909,7 +909,32 @@ DROP VIEW v1;
DROP TABLE t1;
#
# BUG#12601961 "SEGFAULT IN HANDLER::COMPARE_KEY2"
+# BUG#12724899 "SELECT STRAIGHT_JOIN QUERY GIVES 2 DATES VERSUS
+# 2 WARNINGS WITH ICP ON"
#
+CREATE TABLE t1 (
+pk INTEGER NOT NULL,
+i1 INTEGER NOT NULL,
+c1 VARCHAR(1) NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t1 VALUES (1,3,'j'), (20,8,'e');
+EXPLAIN SELECT alias2.i1
+FROM t1 AS alias1 STRAIGHT_JOIN t1 AS alias2
+ON alias2.pk AND alias2.pk <= alias1.c1
+WHERE alias2.pk = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE alias1 ALL NULL NULL NULL NULL 2
+1 SIMPLE alias2 const PRIMARY PRIMARY 4 const 1 Using where
+SELECT alias2.i1
+FROM t1 AS alias1 STRAIGHT_JOIN t1 AS alias2
+ON alias2.pk AND alias2.pk <= alias1.c1
+WHERE alias2.pk = 1;
+i1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'j'
+Warning 1292 Truncated incorrect DOUBLE value: 'e'
+DROP TABLE t1;
#
# BUG#12822678 - 2 MORE ROWS WHEN ICP=ON W/ STRAIGHT_JOIN
#
=== modified file 'mysql-test/r/myisam_icp_none.result'
--- a/mysql-test/r/myisam_icp_none.result 2011-09-01 08:38:18 +0000
+++ b/mysql-test/r/myisam_icp_none.result 2011-09-06 12:45:57 +0000
@@ -908,7 +908,32 @@ DROP VIEW v1;
DROP TABLE t1;
#
# BUG#12601961 "SEGFAULT IN HANDLER::COMPARE_KEY2"
+# BUG#12724899 "SELECT STRAIGHT_JOIN QUERY GIVES 2 DATES VERSUS
+# 2 WARNINGS WITH ICP ON"
#
+CREATE TABLE t1 (
+pk INTEGER NOT NULL,
+i1 INTEGER NOT NULL,
+c1 VARCHAR(1) NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t1 VALUES (1,3,'j'), (20,8,'e');
+EXPLAIN SELECT alias2.i1
+FROM t1 AS alias1 STRAIGHT_JOIN t1 AS alias2
+ON alias2.pk AND alias2.pk <= alias1.c1
+WHERE alias2.pk = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE alias1 ALL NULL NULL NULL NULL 2
+1 SIMPLE alias2 const PRIMARY PRIMARY 4 const 1 Using where
+SELECT alias2.i1
+FROM t1 AS alias1 STRAIGHT_JOIN t1 AS alias2
+ON alias2.pk AND alias2.pk <= alias1.c1
+WHERE alias2.pk = 1;
+i1
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'j'
+Warning 1292 Truncated incorrect DOUBLE value: 'e'
+DROP TABLE t1;
#
# BUG#12822678 - 2 MORE ROWS WHEN ICP=ON W/ STRAIGHT_JOIN
#
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2011-07-04 00:25:46 +0000
+++ b/storage/myisam/ha_myisam.cc 2011-09-06 12:45:57 +0000
@@ -1603,6 +1603,8 @@ int ha_myisam::index_read_idx_map(uchar
key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
+ DBUG_ASSERT(pushed_idx_cond == NULL);
+ DBUG_ASSERT(pushed_idx_cond_keyno == MAX_KEY);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_read_key_count);
int error=mi_rkey(file, buf, index, key, keypart_map, find_flag);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (olav.sandstaa:3438 to 3439) Bug#12724899 | Olav Sandstaa | 6 Sep |