summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorpekka@mysql.com <>2006-05-05 11:18:30 +0200
committerpekka@mysql.com <>2006-05-05 11:18:30 +0200
commitf717495693d51adc5d6e2bbba6bd1493d7a1cc7c (patch)
treea1dd61aa6c4095faddba551b3049812fe074c889 /mysql-test
parent047b9e318b6bffe9ad690c4aeda78a198985884d (diff)
parent5ce418b260461908b84e5e0f34ddc106ef3be99e (diff)
downloadmariadb-git-f717495693d51adc5d6e2bbba6bd1493d7a1cc7c.tar.gz
Merge mysql.com:/space/pekka/ndb/version/my50
into mysql.com:/space/pekka/ndb/version/my50-work
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ndb_condition_pushdown.result60
-rw-r--r--mysql-test/t/ndb_condition_pushdown.test37
2 files changed, 97 insertions, 0 deletions
diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result
index c516740d02c..27a510b252f 100644
--- a/mysql-test/r/ndb_condition_pushdown.result
+++ b/mysql-test/r/ndb_condition_pushdown.result
@@ -1782,5 +1782,65 @@ select * from t5 where b like '%jo%' order by a;
a b
1 jonas
3 johan
+drop table t1;
+create table t1 (a int, b varchar(3), primary key using hash(a))
+engine=ndb;
+insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
+set engine_condition_pushdown = off;
+select * from t1 where b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'ab' or b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'abc';
+a b
+3 abc
+select * from t1 where b like 'abc' or b like 'abc';
+a b
+3 abc
+set engine_condition_pushdown = on;
+select * from t1 where b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'ab' or b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'abc';
+a b
+3 abc
+select * from t1 where b like 'abc' or b like 'abc';
+a b
+3 abc
+drop table t1;
+create table t1 (a int, b char(3), primary key using hash(a))
+engine=ndb;
+insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
+set engine_condition_pushdown = off;
+select * from t1 where b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'ab' or b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'abc';
+a b
+3 abc
+select * from t1 where b like 'abc' or b like 'abc';
+a b
+3 abc
+set engine_condition_pushdown = on;
+select * from t1 where b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'ab' or b like 'ab';
+a b
+2 ab
+select * from t1 where b like 'abc';
+a b
+3 abc
+select * from t1 where b like 'abc' or b like 'abc';
+a b
+3 abc
set engine_condition_pushdown = @old_ecpd;
DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test
index 1e6e105bc61..398ca3c502c 100644
--- a/mysql-test/t/ndb_condition_pushdown.test
+++ b/mysql-test/t/ndb_condition_pushdown.test
@@ -1649,5 +1649,42 @@ set engine_condition_pushdown = on;
explain select * from t5 where b like '%jo%';
select * from t5 where b like '%jo%' order by a;
+# bug#17421 -1
+drop table t1;
+create table t1 (a int, b varchar(3), primary key using hash(a))
+engine=ndb;
+insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
+# in TUP the constants 'ab' 'abc' were expected in varchar format
+# "like" returned error which became "false"
+# scan filter negates "or" which exposes the bug
+set engine_condition_pushdown = off;
+select * from t1 where b like 'ab';
+select * from t1 where b like 'ab' or b like 'ab';
+select * from t1 where b like 'abc';
+select * from t1 where b like 'abc' or b like 'abc';
+set engine_condition_pushdown = on;
+select * from t1 where b like 'ab';
+select * from t1 where b like 'ab' or b like 'ab';
+select * from t1 where b like 'abc';
+select * from t1 where b like 'abc' or b like 'abc';
+
+# bug#17421 -2
+drop table t1;
+create table t1 (a int, b char(3), primary key using hash(a))
+engine=ndb;
+insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
+# test that incorrect MySQL behaviour is preserved
+# 'ab ' LIKE 'ab' is true in MySQL
+set engine_condition_pushdown = off;
+select * from t1 where b like 'ab';
+select * from t1 where b like 'ab' or b like 'ab';
+select * from t1 where b like 'abc';
+select * from t1 where b like 'abc' or b like 'abc';
+set engine_condition_pushdown = on;
+select * from t1 where b like 'ab';
+select * from t1 where b like 'ab' or b like 'ab';
+select * from t1 where b like 'abc';
+select * from t1 where b like 'abc' or b like 'abc';
+
set engine_condition_pushdown = @old_ecpd;
DROP TABLE t1,t2,t3,t4,t5;