db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1083111 - in /db/derby/code/branches/10.6: ./ java/engine/org/apache/derby/impl/sql/compile/ java/testing/org/apache/derbyTesting/functionTests/master/ java/testing/org/apache/derbyTesting/functionTests/tests/lang/
Date Sat, 19 Mar 2011 00:16:28 GMT
Author: kmarsden
Date: Sat Mar 19 00:16:27 2011
New Revision: 1083111

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

Added:
    db/derby/code/branches/10.6/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.6/   (props changed)
    db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
    db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
    db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/master/orderby.out
    db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
    db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/lang/orderby.sql

Propchange: db/derby/code/branches/10.6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Mar 19 00:16:27 2011
@@ -1,2 +1,2 @@
-/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,957902,958163,958257,958264,958508,958522,958555,958618,958939,959550,961892,962716,963206,963705,964039,964115,964402,965647,966393,967201,967304,980089,980684,986689,986834,987539,989099,990292,997325,998170,999119,999479,999485,1002291,1002682,1002853,1021426,1024511,1024528,1025615,1025795,1028716,1030043,1033485,1033864,1038514,1040658,1053724,1055169,1062096,1063809,1065061,1067250,1078461,1081455
+/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,957902,958163,958257,958264,958508,958522,958555,958618,958939,959550,961892,962716,963206,963705,964039,964115,964402,965647,966393,967201,967304,980089,980684,986689,986834,987539,989099,990292,997325,998170,999119,999479,999485,1002291,1002682,1002853,1021426,1024511,1024528,1025615,1025795,1028716,1030043,1033485,1033864,1038514,1040658,1053724,1055169,1062096,1063809,1065061,1067250,1069661,1078461,1081455
 /db/derby/docs/trunk:954344

Modified: db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java?rev=1083111&r1=1083110&r2=1083111&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
(original)
+++ db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
Sat Mar 19 00:16:27 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.6/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java?rev=1083111&r1=1083110&r2=1083111&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
(original)
+++ db/derby/code/branches/10.6/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
Sat Mar 19 00:16:27 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.6/java/testing/org/apache/derbyTesting/functionTests/master/orderby.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/master/orderby.out?rev=1083111&r1=1083110&r2=1083111&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/master/orderby.out
(original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/master/orderby.out
Sat Mar 19 00:16:27 2011
@@ -2243,4 +2243,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.6/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java?rev=1083111&r1=1083110&r2=1083111&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
(original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
Sat Mar 19 00:16:27 2011
@@ -215,6 +215,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.6/java/testing/org/apache/derbyTesting/functionTests/tests/lang/orderby.sql
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/lang/orderby.sql?rev=1083111&r1=1083110&r2=1083111&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/lang/orderby.sql
(original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/lang/orderby.sql
Sat Mar 19 00:16:27 2011
@@ -860,3 +860,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