#At file:///home/marty/MySQL/mysql-5.1-telco-7.1_merge/
3964 Martin Skold 2010-11-09 [merge]
Merge
modified:
mysql-test/suite/ndb/r/ndb_condition_pushdown.result
mysql-test/suite/ndb/t/ndb_condition_pushdown.test
sql/ha_ndbcluster_cond.cc
=== modified file 'mysql-test/suite/ndb/r/ndb_condition_pushdown.result'
--- a/mysql-test/suite/ndb/r/ndb_condition_pushdown.result 2009-12-15 14:44:50 +0000
+++ b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result 2010-11-09 10:32:24 +0000
@@ -2149,5 +2149,17 @@ select * from t where x not like "aa?";
pk x
0 a
drop table t;
+create table t (pk int primary key, x int) engine = ndb;
+insert into t values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5);
+set engine_condition_pushdown = on;
+explain select * from t where 3 between 1+1 and x order by pk;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t ALL NULL NULL NULL NULL 6 Using where; Using filesort
+select * from t where 3 between 1+1 and x order by pk;
+pk x
+3 3
+4 4
+5 5
+drop table t;
set engine_condition_pushdown = @old_ecpd;
DROP TABLE t1,t2,t3,t4,t5;
=== modified file 'mysql-test/suite/ndb/t/ndb_condition_pushdown.test'
--- a/mysql-test/suite/ndb/t/ndb_condition_pushdown.test 2009-12-15 14:44:50 +0000
+++ b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test 2010-11-09 10:32:24 +0000
@@ -2259,6 +2259,14 @@ explain select * from t where x not like
select * from t where x not like "aa?";
drop table t;
+# Bug#57735 BETWEEN in pushed condition cause garbage to be read in ::unpack_record()
+create table t (pk int primary key, x int) engine = ndb;
+insert into t values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5);
+set engine_condition_pushdown = on;
+explain select * from t where 3 between 1+1 and x order by pk;
+select * from t where 3 between 1+1 and x order by pk;
+drop table t;
+
set engine_condition_pushdown = @old_ecpd;
DROP TABLE t1,t2,t3,t4,t5;
=== modified file 'sql/ha_ndbcluster_cond.cc'
--- a/sql/ha_ndbcluster_cond.cc 2010-10-22 12:35:05 +0000
+++ b/sql/ha_ndbcluster_cond.cc 2010-11-09 10:37:54 +0000
@@ -605,12 +605,19 @@ void ndb_serialize_cond(const Item *item
context->expect(Item::FUNC_ITEM);
break;
}
- case Item_func::NEG_FUNC:
case Item_func::UNKNOWN_FUNC:
{
DBUG_PRINT("info", ("UNKNOWN_FUNC %s",
func_item->const_item()?"const":""));
DBUG_PRINT("info", ("result type %d", func_item->result_type()));
+ if (context->rewrite_stack)
+ {
+ DBUG_PRINT("info", ("Function during rewrite not supported"));
+ context->supported= FALSE;
+ }
+ }
+ case Item_func::NEG_FUNC:
+ {
if (func_item->const_item())
{
switch (func_item->result_type()) {
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.1 branch (Martin.Skold:3964) Bug#57735 | Martin Skold | 9 Nov |