#At file:///home/marty/MySQL/mysql-5.1-telco-6.2_merge/
3134 Martin Skold 2010-11-09
Bug#57735 BETWEEN in pushed condition cause garbage to be read in ::unpack_record(): disabled pushing conditions with functions to be evaluated during rewrite (of IN/BETWEEN)
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 13:21:43 +0000
+++ b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result 2010-11-09 10:14:40 +0000
@@ -2030,5 +2030,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 13:21:43 +0000
+++ b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test 2010-11-09 10:14:40 +0000
@@ -2129,5 +2129,13 @@ 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 2009-12-15 13:21:43 +0000
+++ b/sql/ha_ndbcluster_cond.cc 2010-11-09 10:14:40 +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-6.2 branch (Martin.Skold:3134) Bug#57735 | Martin Skold | 9 Nov |