summaryrefslogtreecommitdiff
path: root/mysql-test/r/myisam_icp.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-10-11 02:36:08 -0700
committerIgor Babaev <igor@askmonty.org>2011-10-11 02:36:08 -0700
commit8feff690b6d1f09acb6a68315669e75924da5f80 (patch)
treeaebd3881e94a09cfd575d399e3ce2862241647bb /mysql-test/r/myisam_icp.result
parentdaf52954a88ca9a67e9d08967d369d57b12dc843 (diff)
downloadmariadb-git-8feff690b6d1f09acb6a68315669e75924da5f80.tar.gz
Fixed LP bug #870046.
This bug is a consequence of the fix in the function add_ref_to_table_cond for LP bug 826935 that turned out to be not quite correct: it tried to AND the same generated condition with two different other conditions. This patch creates a copy of the generated condition if the condition needs to be ANDed with two different items.
Diffstat (limited to 'mysql-test/r/myisam_icp.result')
-rw-r--r--mysql-test/r/myisam_icp.result22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/myisam_icp.result b/mysql-test/r/myisam_icp.result
index d3e1114b39c..b5b54e94319 100644
--- a/mysql-test/r/myisam_icp.result
+++ b/mysql-test/r/myisam_icp.result
@@ -238,4 +238,26 @@ SELECT b FROM t1 WHERE a != 1 AND c IS NULL ORDER BY 1;
b
byluovkgwoukfxedyeffsedajyqkyhpaqqpozn
DROP TABLE t1;
+#
+# Bug#870046: ICP for a GROUP BY query
+#
+CREATE TABLE t1 (a int, b varchar(1), c varchar(1), INDEX idx(b));
+INSERT INTO t1 VALUES (2,'x','x'), (5,'x','y');
+SET SESSION optimizer_switch='index_condition_pushdown=off';
+EXPLAIN
+SELECT a, MIN(c) FROM t1 WHERE b = 'x' AND c > 'x' GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx idx 4 const 1 Using where; Using temporary; Using filesort
+SELECT a, MIN(c) FROM t1 WHERE b = 'x' AND c > 'x' GROUP BY a;
+a MIN(c)
+5 y
+SET SESSION optimizer_switch='index_condition_pushdown=on';
+EXPLAIN
+SELECT a, MIN(c) FROM t1 WHERE b = 'x' AND c > 'x' GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx idx 4 const 1 Using index condition; Using where; Using temporary; Using filesort
+SELECT a, MIN(c) FROM t1 WHERE b = 'x' AND c > 'x' GROUP BY a;
+a MIN(c)
+5 y
+DROP TABLE t1;
set optimizer_switch=@myisam_icp_tmp;