db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1068196 - in /db/derby/code/branches/10.5/java: engine/org/apache/derby/impl/sql/compile/SelectNode.java testing/org/apache/derbyTesting/junit/RuntimeStatisticsParser.java
Date Mon, 07 Feb 2011 22:43:49 GMT
Author: kmarsden
Date: Mon Feb  7 22:43:49 2011
New Revision: 1068196

URL: http://svn.apache.org/viewvc?rev=1068196&view=rev
Log:
DERBY-4736 ASSERT FAIL when code generating a column reference in a join predicate in presence
of other outer join reordering

port to 10.5
Contributed by Dag H. Wanvik


Modified:
    db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/RuntimeStatisticsParser.java

Modified: db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java?rev=1068196&r1=1068195&r2=1068196&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
(original)
+++ db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
Mon Feb  7 22:43:49 2011
@@ -851,6 +851,7 @@ public class SelectNode extends ResultSe
 																	 getNodeFactory().doJoinOrderOptimization(),
 																	 getContextManager());
 			bindExpressions(afromList);
+            fromList.bindResultColumns(afromList);
 		}
 
 		/* Preprocess the fromList.  For each FromTable, if it is a FromSubquery

Modified: db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/RuntimeStatisticsParser.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/RuntimeStatisticsParser.java?rev=1068196&r1=1068195&r2=1068196&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/RuntimeStatisticsParser.java
(original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/RuntimeStatisticsParser.java
Mon Feb  7 22:43:49 2011
@@ -346,5 +346,45 @@ public class RuntimeStatisticsParser {
     public String toString() {
         return statistics;
     }
+    /**
+     * Assert that a sequence of string exists in the statistics.
+     * <p>/
+     * The strings in the argument are each assumed to start a line. Leading
+     * underscores are converted to tab characters before comparing.
+     *
+     * @param strings The sequence of string expected to be found.
+     */
+    public void assertSequence(String[] strings) {
+
+        // Make strings ready for comparison:
+        for (int i=0; i < strings.length; i++) {
+            StringBuffer sb = new StringBuffer();
+
+            sb.append('\n');
+            
+            for (int j=0; j < strings[i].length(); j++) {
+                if (strings[i].charAt(j) == '_') {
+                    sb.append('\t');
+                } else {
+                    sb.append(strings[i].substring(j));
+                    break;
+                }
+            }
+            strings[i] = sb.toString();
+        }
+
+        int matchIdx = 0; // which string to match next
+        String window = statistics;
+        for (int i = 0; i < strings.length; i++) {
+            int pos = window.indexOf(strings[i]);
+
+            if (pos == -1) {
+                throw new AssertionError(
+                    "Sequence not found in statistics");
+            }
+
+            window = window.substring(pos + 1);
+        }
+    }
 }
     



Mime
View raw message