summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-11-11 14:53:26 -0800
committerIgor Babaev <igor@askmonty.org>2011-11-11 14:53:26 -0800
commitb91a6bd88b7ae0db674b60e9b0415f3656b7471d (patch)
tree8adec6062d035de62c20c398137cf324b071d1ec /mysql-test/r
parent402258ff9577b35646460f90e6db1c95d13a826a (diff)
downloadmariadb-git-b91a6bd88b7ae0db674b60e9b0415f3656b7471d.tar.gz
Fixed LP bug #879871.
The function add_ref_to_table_cond missed updating the value of join_tab->pre_idx_push_select_cond after having updated the value of join_tab->select->pre_idx_push_select_cond.
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/innodb_icp.result15
-rw-r--r--mysql-test/r/maria_icp.result15
-rw-r--r--mysql-test/r/myisam_icp.result15
3 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/r/innodb_icp.result b/mysql-test/r/innodb_icp.result
index 9bfa3990970..739035b005c 100644
--- a/mysql-test/r/innodb_icp.result
+++ b/mysql-test/r/innodb_icp.result
@@ -686,5 +686,20 @@ HAVING t1.c != 5 ORDER BY t1.c;
b c
1 4
DROP TABLE t1,t2;
+#
+# Bug#879871: InnoDB: possible ICP + GROUP BY primary index
+#
+CREATE TABLE t1 (
+a int NOT NULL, b int, c varchar(1), d varchar(1),
+PRIMARY KEY (a), KEY c (c,b)
+);
+INSERT INTO t1 VALUES (10,8,'g','g');
+SET SESSION optimizer_switch='index_condition_pushdown=off';
+SELECT a FROM t1 WHERE c IS NULL AND d IS NOT NULL GROUP BY 1;
+a
+SET SESSION optimizer_switch='index_condition_pushdown=on';
+SELECT a FROM t1 WHERE c IS NULL AND d IS NOT NULL GROUP BY 1;
+a
+DROP TABLE t1;
set optimizer_switch=@innodb_icp_tmp;
set storage_engine= @save_storage_engine;
diff --git a/mysql-test/r/maria_icp.result b/mysql-test/r/maria_icp.result
index f71df0a9867..2d755daf0d6 100644
--- a/mysql-test/r/maria_icp.result
+++ b/mysql-test/r/maria_icp.result
@@ -692,5 +692,20 @@ HAVING t1.c != 5 ORDER BY t1.c;
b c
1 4
DROP TABLE t1,t2;
+#
+# Bug#879871: InnoDB: possible ICP + GROUP BY primary index
+#
+CREATE TABLE t1 (
+a int NOT NULL, b int, c varchar(1), d varchar(1),
+PRIMARY KEY (a), KEY c (c,b)
+);
+INSERT INTO t1 VALUES (10,8,'g','g');
+SET SESSION optimizer_switch='index_condition_pushdown=off';
+SELECT a FROM t1 WHERE c IS NULL AND d IS NOT NULL GROUP BY 1;
+a
+SET SESSION optimizer_switch='index_condition_pushdown=on';
+SELECT a FROM t1 WHERE c IS NULL AND d IS NOT NULL GROUP BY 1;
+a
+DROP TABLE t1;
set storage_engine= @save_storage_engine;
set optimizer_switch=@maria_icp_tmp;
diff --git a/mysql-test/r/myisam_icp.result b/mysql-test/r/myisam_icp.result
index 6799682c273..b73e98e2aea 100644
--- a/mysql-test/r/myisam_icp.result
+++ b/mysql-test/r/myisam_icp.result
@@ -690,6 +690,21 @@ HAVING t1.c != 5 ORDER BY t1.c;
b c
1 4
DROP TABLE t1,t2;
+#
+# Bug#879871: InnoDB: possible ICP + GROUP BY primary index
+#
+CREATE TABLE t1 (
+a int NOT NULL, b int, c varchar(1), d varchar(1),
+PRIMARY KEY (a), KEY c (c,b)
+);
+INSERT INTO t1 VALUES (10,8,'g','g');
+SET SESSION optimizer_switch='index_condition_pushdown=off';
+SELECT a FROM t1 WHERE c IS NULL AND d IS NOT NULL GROUP BY 1;
+a
+SET SESSION optimizer_switch='index_condition_pushdown=on';
+SELECT a FROM t1 WHERE c IS NULL AND d IS NOT NULL GROUP BY 1;
+a
+DROP TABLE t1;
drop table if exists t0, t1, t1i, t1m;
#
# BUG#826935 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed