You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by mi...@apache.org on 2006/08/29 20:09:08 UTC
svn commit: r438138 - in
/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests:
master/predicatePushdown.out tests/lang/predicatePushdown.sql
Author: mikem
Date: Tue Aug 29 11:09:07 2006
New Revision: 438138
URL: http://svn.apache.org/viewvc?rev=438138&view=rev
Log:
DERBY-1681
merging change 437380 from trunk to 10.1 branch. This change adds the
testcase for this issue.
Modified:
db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/predicatePushdown.out
db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/predicatePushdown.sql
Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/predicatePushdown.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/predicatePushdown.out?rev=438138&r1=438137&r2=438138&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/predicatePushdown.out (original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/predicatePushdown.out Tue Aug 29 11:09:07 2006
@@ -10521,7 +10521,90 @@
t3stuff:|6 |6 |t3stuff: |6 |6
t3stuff:|9 |9 |morestuff:|9 |9
t3stuff:|9 |9 |t3stuff: |9 |9
-ij> -- Clean-up from DERBY-1633.
+ij> -- DERBY-1681:
+-- In order to reproduce the issue described in DERBY-1681
+-- we have to have a minimum amount of data in the tables;
+-- if we have too little, then somehow that affects the
+-- plan and we won't see the incorrect results.
+insert into t1 select * from t2;
+3 rows inserted/updated/deleted
+ij> insert into t2 select * from t3;
+3 rows inserted/updated/deleted
+ij> insert into t3 select * from t1;
+5 rows inserted/updated/deleted
+ij> insert into t1 select * from t2;
+6 rows inserted/updated/deleted
+ij> insert into t2 select * from t3;
+8 rows inserted/updated/deleted
+ij> insert into t3 select * from t1;
+11 rows inserted/updated/deleted
+ij> insert into t1 select * from t2;
+14 rows inserted/updated/deleted
+ij> insert into t2 select * from t3;
+19 rows inserted/updated/deleted
+ij> insert into t3 select * from t1;
+25 rows inserted/updated/deleted
+ij> insert into t1 select * from t2;
+33 rows inserted/updated/deleted
+ij> insert into t2 select * from t3;
+44 rows inserted/updated/deleted
+ij> insert into t3 select * from t1;
+58 rows inserted/updated/deleted
+ij> -- Now can just run one of the queries from DERBY-1633 to test
+-- the fix. Before DERBY-1681 this query would return 84 rows
+-- and it was clear that the predicate wasn't being enforced;
+-- after the fix, we should only see 42 rows and for every row
+-- the first and second column should be equal.
+select topview4.col3, x1.col3 from
+ topview x1
+ left join
+ topview4
+ on topview4.col3 = x1.col3;
+COL3 |COL3
+---------------------
+1 |1
+1 |1
+2 |2
+2 |2
+3 |3
+3 |3
+4 |4
+4 |4
+6 |6
+6 |6
+8 |8
+8 |8
+9 |9
+9 |9
+1 |1
+1 |1
+2 |2
+2 |2
+3 |3
+3 |3
+4 |4
+4 |4
+6 |6
+6 |6
+8 |8
+8 |8
+9 |9
+9 |9
+1 |1
+1 |1
+2 |2
+2 |2
+3 |3
+3 |3
+4 |4
+4 |4
+6 |6
+6 |6
+8 |8
+8 |8
+9 |9
+9 |9
+ij> -- Clean-up from DERBY-1633 and DERBY-1681.
drop view topview;
0 rows inserted/updated/deleted
ij> drop view topview2;
Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/predicatePushdown.sql
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/predicatePushdown.sql?rev=438138&r1=438137&r2=438138&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/predicatePushdown.sql (original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/predicatePushdown.sql Tue Aug 29 11:09:07 2006
@@ -1096,7 +1096,38 @@
left join topview5 --DERBY-PROPERTIES joinStrategy=NESTEDLOOP
on topview5.col3 = x1.col3;
--- Clean-up from DERBY-1633.
+-- DERBY-1681:
+-- In order to reproduce the issue described in DERBY-1681
+-- we have to have a minimum amount of data in the tables;
+-- if we have too little, then somehow that affects the
+-- plan and we won't see the incorrect results.
+
+insert into t1 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t1;
+insert into t1 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t1;
+
+-- Now can just run one of the queries from DERBY-1633 to test
+-- the fix. Before DERBY-1681 this query would return 84 rows
+-- and it was clear that the predicate wasn't being enforced;
+-- after the fix, we should only see 42 rows and for every row
+-- the first and second column should be equal.
+
+select topview4.col3, x1.col3 from
+ topview x1
+ left join
+ topview4
+ on topview4.col3 = x1.col3;
+
+-- Clean-up from DERBY-1633 and DERBY-1681.
drop view topview;
drop view topview2;