#At file:///home/oleja/mysql/mysql-5.1-telco-7.0-spj-scan-scan/ based on revid:ole.john.aske@stripped
3317 Ole John Aske 2010-10-16
Fix for SPJ variant of bug 57396: Create correct AttributeHeader for an open bound.
modified:
mysql-test/suite/ndb/r/ndb_join_pushdown.result
mysql-test/suite/ndb/t/ndb_join_pushdown.test
storage/ndb/src/ndbapi/NdbQueryOperation.cpp
=== modified file 'mysql-test/suite/ndb/r/ndb_join_pushdown.result'
--- a/mysql-test/suite/ndb/r/ndb_join_pushdown.result 2010-10-15 13:49:39 +0000
+++ b/mysql-test/suite/ndb/r/ndb_join_pushdown.result 2010-10-16 15:05:21 +0000
@@ -4043,6 +4043,17 @@ pk
1
2
drop table t;
+create table t (b int, a int, primary key (a,b)) engine=ndb;
+insert into t values(0,0);
+explain
+select * from t as t1 join t as t2 on t2.a=t1.a where t1.a < 8 or t1.a >= 8;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 0 NULL 10 Parent of 2 pushed join@1; Using where with pushed condition
+1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a 1 Child of pushed join@1
+select * from t as t1 join t as t2 on t2.a=t1.a where t1.a < 8 or t1.a >= 8;
+b a b a
+0 0 0 0
+drop table t;
create temporary table spj_counts_at_end
select counter_name, sum(val) AS val
from ndbinfo.counters
@@ -4060,10 +4071,10 @@ counter_name spj_counts_at_end.val - spj
CONST_PRUNED_RANGE_SCANS_RECEIVED 6
LOCAL_TABLE_SCANS_SENT 196
PRUNED_RANGE_SCANS_RECEIVED 16
-RANGE_SCANS_RECEIVED 203
+RANGE_SCANS_RECEIVED 205
READS_NOT_FOUND 405
READS_RECEIVED 61
-SCAN_ROWS_RETURNED 63641
+SCAN_ROWS_RETURNED 63643
TABLE_SCANS_RECEIVED 196
select sum(spj_counts_at_end.val - spj_counts_at_startup.val) as 'LOCAL+REMOTE READS_SENT'
from spj_counts_at_end, spj_counts_at_startup
@@ -4075,15 +4086,15 @@ LOCAL+REMOTE READS_SENT
drop table spj_counts_at_startup;
drop table spj_counts_at_end;
scan_count
-2000
+2003
pruned_scan_count
7
sorted_scan_count
44
pushed_queries_defined
-339
+341
pushed_queries_dropped
11
pushed_queries_executed
-264
+265
set ndb_join_pushdown = @save_ndb_join_pushdown;
=== modified file 'mysql-test/suite/ndb/t/ndb_join_pushdown.test'
--- a/mysql-test/suite/ndb/t/ndb_join_pushdown.test 2010-10-15 13:49:39 +0000
+++ b/mysql-test/suite/ndb/t/ndb_join_pushdown.test 2010-10-16 15:05:21 +0000
@@ -2869,7 +2869,18 @@ SELECT DISTINCT STRAIGHT_JOIN table1.pk
drop table t;
+########
+# SPJ variant of bug#57396
+# Test correct format of an 'open bound'
+########
+create table t (b int, a int, primary key (a,b)) engine=ndb;
+insert into t values(0,0);
+
+explain
+select * from t as t1 join t as t2 on t2.a=t1.a where t1.a < 8 or t1.a >= 8;
+select * from t as t1 join t as t2 on t2.a=t1.a where t1.a < 8 or t1.a >= 8;
+drop table t;
########################################
# Verify DBSPJ counters for entire test:
=== modified file 'storage/ndb/src/ndbapi/NdbQueryOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbQueryOperation.cpp 2010-10-15 21:04:14 +0000
+++ b/storage/ndb/src/ndbapi/NdbQueryOperation.cpp 2010-10-16 15:05:21 +0000
@@ -1490,7 +1490,7 @@ NdbQueryImpl::setBound(const NdbRecord *
* To encode this, we'll request all rows where the first
* key column value is >= NULL
*/
- AttributeHeader ah(key_record->columns[0].index_attrId, 0);
+ AttributeHeader ah(0, 0);
m_keyInfo.append(NdbIndexScanOperation::BoundLE);
m_keyInfo.append(ah.m_value);
}
Attachment: [text/bzr-bundle] bzr/ole.john.aske@oracle.com-20101016150521-xu6yvbpq3ea2r7vy.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch(ole.john.aske:3317) | Ole John Aske | 16 Oct |