From 303cdacd0931c293567f1d84789be331a6ed4d0d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 May 2006 00:53:34 +0200 Subject: 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 --- mysql-test/t/ndb_condition_pushdown.test | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'mysql-test/t/ndb_condition_pushdown.test') 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; -- cgit v1.2.1