db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: r357105 - /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java
Date Fri, 16 Dec 2005 02:13:10 GMT
Author: bandaram
Date: Thu Dec 15 18:13:07 2005
New Revision: 357105

URL: http://svn.apache.org/viewcvs?rev=357105&view=rev
Log:
DERBY-649: Improve predicate check added in the previous checkin for this bug.

We may be incorrectly allowing predicates like b=a+5 for the Union predicate
push down optimization, when the code can't yet handle it.

Many thanks to Dan for catching this case.

Submitted by Satheesh Bandaram (satheesh@sourcery.org)

Modified:
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java?rev=357105&r1=357104&r2=357105&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/PredicateList.java
Thu Dec 15 18:13:07 2005
@@ -1422,7 +1422,9 @@
 					continue;
 
 				BinaryRelationalOperatorNode opNode = (BinaryRelationalOperatorNode) andNode.getLeftOperand();
-				if(! (opNode.getLeftOperand() instanceof ColumnReference))
+				if (! (opNode.getLeftOperand() instanceof ColumnReference) ||
+				    ! (opNode.getRightOperand() instanceof ConstantNode ||
+					 opNode.getRightOperand() instanceof ParameterNode))
 					continue;
 
 				ColumnReference crNode = (ColumnReference) opNode.getLeftOperand();



Mime
View raw message