summaryrefslogtreecommitdiff
path: root/mysql-test/include/icp_tests.inc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-11-04 05:39:45 -0700
committerIgor Babaev <igor@askmonty.org>2011-11-04 05:39:45 -0700
commit928e94fb98b34e511d89c1ca38e35b42656c9313 (patch)
tree74863e1e60120f9bd64a67ecbe9308b930bef86d /mysql-test/include/icp_tests.inc
parentc1ebb566b36df00ad21a8b9d35ab6ad9de5e0b5b (diff)
downloadmariadb-git-928e94fb98b34e511d89c1ca38e35b42656c9313.tar.gz
Fixed LP bug #885168.
The call of the virtual function cancel_pushed_idx_cond in the code of the function test_if_skip_sort_order was misplaced when backporting the fix for bug 58816.
Diffstat (limited to 'mysql-test/include/icp_tests.inc')
-rw-r--r--mysql-test/include/icp_tests.inc29
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc
index c219bf9cdc2..2814c4f10b5 100644
--- a/mysql-test/include/icp_tests.inc
+++ b/mysql-test/include/icp_tests.inc
@@ -668,3 +668,32 @@ WHERE (6, 234) IN (
DROP TABLE t1,t2,t3,t4;
set optimizer_switch= @tmp_778434;
+
+--echo #
+--echo # Bug#885168: ICP for one index + potential ORDER BY for another
+--echo #
+
+CREATE TABLE t1 (a varchar(64), b varchar(10), INDEX(a), INDEX(b)) ;
+INSERT INTO t1 VALUES
+ ('Ohio','Iowa'), ('k','d'), ('bdkpj','mbdkpjdanp'), ('d','xdmbdkpjda'),
+ ('fkxdmbdkpjdanpje','o'), ('f','Pennsylvan'), ('Virginia','ei');
+
+SET SESSION optimizer_switch='index_condition_pushdown=off';
+EXPLAIN
+SELECT * FROM t1
+ WHERE NOT(b = 'Texas') AND b BETWEEN 'wy' AND 'y' OR b = 'Pennsylvania'
+ ORDER BY a;
+SELECT * FROM t1
+ WHERE NOT(b = 'Texas') AND b BETWEEN 'wy' AND 'y' OR b = 'Pennsylvania'
+ ORDER BY a;
+
+SET SESSION optimizer_switch='index_condition_pushdown=on';
+EXPLAIN
+SELECT * FROM t1
+ WHERE NOT(b = 'Texas') AND b BETWEEN 'wy' AND 'y' OR b = 'Pennsylvania'
+ ORDER BY a;
+SELECT * FROM t1
+ WHERE NOT(b = 'Texas') AND b BETWEEN 'wy' AND 'y' OR b = 'Pennsylvania'
+ ORDER BY a;
+
+DROP TABLE t1;