db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1083105 - in /db/derby/code/branches/10.7: ./ java/engine/org/apache/derby/impl/sql/compile/ java/testing/org/apache/derbyTesting/functionTests/master/ java/testing/org/apache/derbyTesting/functionTests/tests/lang/
Date Fri, 18 Mar 2011 23:19:50 GMT
Author: kmarsden
Date: Fri Mar 18 23:19:49 2011
New Revision: 1083105

URL: http://svn.apache.org/viewvc?rev=1083105&view=rev
Log:
DERBY-5005 Error when fully qualifying a field from a view in an ORDER BY clause
Contributed by Dag H Wanvik


Added:
    db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/lang/Derby5005Test.java
      - copied unchanged from r1069661, db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/Derby5005Test.java
Modified:
    db/derby/code/branches/10.7/   (props changed)
    db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
    db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
    db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/master/orderby.out
    db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
    db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/lang/orderby.sql

Propchange: db/derby/code/branches/10.7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar 18 23:19:49 2011
@@ -1 +1 @@
-/db/derby/code/trunk:1035603,1036769,1038514,1038813,1039084,1039268,1040658,1041338,1043227,1043389,1044096,1051026,1053724,1055169,1059888,1060480,1062096,1063809,1065061,1066290,1067250,1067357,1071463,1076387,1078461,1078693,1081455
+/db/derby/code/trunk:1035603,1036769,1038514,1038813,1039084,1039268,1040658,1041338,1043227,1043389,1044096,1051026,1053724,1055169,1059888,1060480,1062096,1063809,1065061,1066290,1067250,1067357,1069661,1071463,1076387,1078461,1078693,1081455

Modified: db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java?rev=1083105&r1=1083104&r2=1083105&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
(original)
+++ db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
Fri Mar 18 23:19:49 2011
@@ -148,7 +148,19 @@ public class FromSubquery extends FromTa
 	protected FromTable getFromTableByName(String name, String schemaName, boolean exactMatch)
 		throws StandardException
 	{
-		return super.getFromTableByName(name, schemaName, exactMatch);
+        if (schemaName != null && origTableName != null) {
+            // View can have schema
+            if (!schemaName.equals(origTableName.schemaName)) {
+                return null;
+            }
+            // So far, so good, now go on to compare table name
+        }
+
+        if (getExposedName().equals(name)) {
+            return this;
+        }
+
+        return null;
 	}
 
 	/**

Modified: db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java?rev=1083105&r1=1083104&r2=1083105&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
(original)
+++ db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
Fri Mar 18 23:19:49 2011
@@ -114,7 +114,7 @@ public class OrderByList extends Ordered
 
 	/**
 	 *	Bind the update columns by their names to the target resultset of the
-	 * cursor specification. This variant is used by InsertNode.
+     * cursor specification.
 	 *
 	 * 	@param target	The underlying result set
 	 *	@exception StandardException		Thrown on error

Modified: db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/master/orderby.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/master/orderby.out?rev=1083105&r1=1083104&r2=1083105&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/master/orderby.out
(original)
+++ db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/master/orderby.out
Fri Mar 18 23:19:49 2011
@@ -2318,4 +2318,7 @@ ij> select k as s from d3303 group by i,
 ERROR 42X77: Column position '2' is out of range for the query expression.
 ij> drop table d3303;
 0 rows inserted/updated/deleted
+ij> -- See also Derby5005.java which should be merged with this test when
+-- it gets converted to JUnit.
+;
 ij> 

Modified: db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java?rev=1083105&r1=1083104&r2=1083105&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
(original)
+++ db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
Fri Mar 18 23:19:49 2011
@@ -218,6 +218,7 @@ public class _Suite extends BaseTestCase
         suite.addTest(SequenceGeneratorTest.suite());
         suite.addTest(OLAPTest.suite());
         suite.addTest(OrderByAndOffsetFetchInSubqueries.suite());
+        suite.addTest(Derby5005Test.suite());
         suite.addTest(AutoIncrementTest.suite());
         return suite;
 	}

Modified: db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/lang/orderby.sql
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/lang/orderby.sql?rev=1083105&r1=1083104&r2=1083105&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/lang/orderby.sql
(original)
+++ db/derby/code/branches/10.7/java/testing/org/apache/derbyTesting/functionTests/tests/lang/orderby.sql
Fri Mar 18 23:19:49 2011
@@ -901,3 +901,6 @@ select k from d3303 group by i,k order b
 select k as s from d3303 group by i,k order by 2;
 
 drop table d3303;
+
+-- See also Derby5005.java which should be merged with this test when
+-- it gets converted to JUnit.



Mime
View raw message