diff options
author | unknown <pekka@mysql.com> | 2006-05-05 00:53:34 +0200 |
---|---|---|
committer | unknown <pekka@mysql.com> | 2006-05-05 00:53:34 +0200 |
commit | 303cdacd0931c293567f1d84789be331a6ed4d0d (patch) | |
tree | 3f9b4caabdfe06640667b373f46612e69a649074 /mysql-test/t/ndb_condition_pushdown.test | |
parent | ab7c8587e7450f0626a0e1cabd885c1a5d8fab1b (diff) | |
download | mariadb-git-303cdacd0931c293567f1d84789be331a6ed4d0d.tar.gz |
ndb - bug#17421, changes NDB API pushdown LIKE arg to plain char
mysql-test/r/ndb_condition_pushdown.result:
bug#17421, changes NDB API pushdown LIKE arg to plain char
mysql-test/t/ndb_condition_pushdown.test:
bug#17421, changes NDB API pushdown LIKE arg to plain char
ndb/include/ndbapi/NdbOperation.hpp:
bug#17421, changes NDB API pushdown LIKE arg to plain char
ndb/include/util/NdbSqlUtil.hpp:
bug#17421, changes NDB API pushdown LIKE arg to plain char
ndb/src/common/util/NdbSqlUtil.cpp:
bug#17421, changes NDB API pushdown LIKE arg to plain char
Diffstat (limited to 'mysql-test/t/ndb_condition_pushdown.test')
-rw-r--r-- | mysql-test/t/ndb_condition_pushdown.test | 37 |
1 files changed, 37 insertions, 0 deletions
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; |