db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r943633 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java
Date Wed, 12 May 2010 18:51:53 GMT
Author: rhillegas
Date: Wed May 12 18:51:53 2010
New Revision: 943633

URL: http://svn.apache.org/viewvc?rev=943633&view=rev
Log:
DERBY-4651: Raise an exception rather than return wrong results in this problem scenario.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java?rev=943633&r1=943632&r2=943633&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java Wed May
12 18:51:53 2010
@@ -1331,8 +1331,11 @@ public class FromVTI extends FromTable i
         {
             AndNode andOperator = (AndNode) clause;
 
-            // strip off trailing vacuous constant if present
-            if ( andOperator.getRightOperand() instanceof BooleanConstantNode )
+            // strip off trailing vacuous TRUE constant if present
+            if (
+                andOperator.getRightOperand() instanceof BooleanConstantNode &&
+                ( ((BooleanConstantNode) andOperator.getRightOperand()).isBooleanTrue() )
+                )
             { return makeRestriction( andOperator.getLeftOperand(), columnNameMap ); }
             
             Restriction leftRestriction = makeRestriction( andOperator.getLeftOperand(),
columnNameMap );
@@ -1346,8 +1349,11 @@ public class FromVTI extends FromTable i
         {
             OrNode orOperator = (OrNode) clause;
             
-            // strip off trailing vacuous constant if present
-            if ( orOperator.getRightOperand() instanceof BooleanConstantNode )
+            // strip off trailing vacuous FALSE constant if present
+            if (
+                orOperator.getRightOperand() instanceof BooleanConstantNode &&
+                ( ((BooleanConstantNode) orOperator.getRightOperand()).isBooleanFalse() )
+                )
             { return makeRestriction( orOperator.getLeftOperand(), columnNameMap ); }
             
             Restriction leftRestriction = makeRestriction( orOperator.getLeftOperand(), columnNameMap
);



Mime
View raw message