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 rh...@apache.org on 2007/10/22 22:15:25 UTC
svn commit: r587230 - in /db/derby/code/trunk/java:
engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
testing/org/apache/derbyTesting/functionTests/tests/lang/SysDiagVTIMappingTest.java
Author: rhillegas
Date: Mon Oct 22 13:15:24 2007
New Revision: 587230
URL: http://svn.apache.org/viewvc?rev=587230&view=rev
Log:
DERBY-3138: Fix for this bug is to use the correct overload of accept() during preprocessing.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SysDiagVTIMappingTest.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java?rev=587230&r1=587229&r2=587230&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java Mon Oct 22 13:15:24 2007
@@ -230,7 +230,7 @@
throws StandardException
{
CollectNodesVisitor getCRs = new CollectNodesVisitor(ColumnReference.class);
- super.accept(getCRs);
+ accept(getCRs);
Vector colRefs = getCRs.getList();
for (Enumeration e = colRefs.elements(); e.hasMoreElements(); )
{
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SysDiagVTIMappingTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SysDiagVTIMappingTest.java?rev=587230&r1=587229&r2=587230&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SysDiagVTIMappingTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SysDiagVTIMappingTest.java Mon Oct 22 13:15:24 2007
@@ -649,6 +649,35 @@
st.close();
}
+ /**
+ * Test that diagnostic VTIs will work correctly when they
+ * are invoked in a subquery with correlated references to
+ * outer query blocks. DERBY-3138.
+ */
+ public void testCorrelatedReferences() throws SQLException
+ {
+ Statement st = createStatement();
+ String [][] expRS = new String [][] {};
+
+ ResultSet rs = st.executeQuery
+ (
+ "select s.schemaname, t.tableName\n" +
+ "from sys.sysschemas s, sys.systables t\n" +
+ "where t.schemaid=s.schemaid\n" +
+ "and exists\n" +
+ "(\n" +
+ " select vti.*\n" +
+ " from table( syscs_diag.space_table( s.schemaname, t.tableName ) ) as vti\n" +
+ " where vti.numfreepages < -1\n" +
+ ")\n"
+ );
+
+ JDBC.assertFullResultSet(rs, expRS);
+
+ rs.close();
+ st.close();
+ }
+
/* All statements in this method should fail because a VTI table-
* mapping that takes arguments can only be used as part of the TABLE
* constructor. Any other uses of, or attempts to modify, such a