db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r885659 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl: sql/execute/BasicSortObserver.java store/access/sort/MergeSort.java
Date Tue, 01 Dec 2009 02:49:28 GMT
Author: dag
Date: Tue Dec  1 02:49:15 2009
New Revision: 885659

URL: http://svn.apache.org/viewvc?rev=885659&view=rev
Log:
DERBY-4413 INSERT from SELECT DISTINCT gives assertFailure (sane), or NPE (insane) in presence
of generated columns

After DERBY-4442 went in, the exception to the ASSERT check we made in
the original fix for this issue should be rolled back, so as to
provide a better internal consistency check. Patch derby-4413-rollback
does this.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java?rev=885659&r1=885658&r2=885659&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java
Tue Dec  1 02:49:15 2009
@@ -168,12 +168,7 @@
 		{
 			// the only difference between getClone and cloneObject is cloneObject does
 			// not objectify a stream.  We use getClone here.  Beetle 4896.
-
-			// DERBY-4413 shows that the value for a generated column will be
-			// null as the result set is computed as part of an INSERT INTO, so
-			// accept a null also.
-			newArray[i] =
-				(origArray[i] != null ? origArray[i].getClone() : null);
+			newArray[i] = origArray[i].getClone();
 		}
 
 		return newArray;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java?rev=885659&r1=885658&r2=885659&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java
Tue Dec  1 02:49:15 2009
@@ -126,12 +126,6 @@
 	**/
 	protected boolean columnOrderingNullsLowMap[];
 
-
-	/**
-    Determine whether a column is used for ordering or not.
-	**/
-	private boolean isOrderingColumn[];
-
 	/**
 	The sort observer.  May be null.  Used as a callback.
 	**/
@@ -461,18 +455,8 @@
                 Object col2 = template[colid];
                 if (col1 == null)
 				{
-					if (!isOrderingColumn[colid]) {
-
-						// DERBY-4413 shows that the value for a generated
-						// column will be null as the result set is computed as
-						// part of an INSERT INTO, so accept a null also.
-						// This column would not be part of the sort key.
-
-						continue;
-
-					} else {
-						SanityManager.THROWASSERT("col[" + colid + "] is null");
-					}
+					SanityManager.THROWASSERT(
+						"col[" + colid + "]  is null");
 				}
 						
                 if (!(col1 instanceof CloneableObject))
@@ -562,27 +546,13 @@
         columnOrderingMap          = new int[columnOrdering.length];
         columnOrderingAscendingMap = new boolean[columnOrdering.length];
         columnOrderingNullsLowMap  = new boolean[columnOrdering.length];
-
-		if (SanityManager.DEBUG) {
-			isOrderingColumn = new boolean[template.length];
-
-			for (int i = 0; i < isOrderingColumn.length; i++) {
-				isOrderingColumn[i] = false;
-			}
-		}
-
-		for (int i = 0; i < columnOrdering.length; i++)
+        for (int i = 0; i < columnOrdering.length; i++)
         {
             columnOrderingMap[i] = columnOrdering[i].getColumnId();
             columnOrderingAscendingMap[i] = columnOrdering[i].getIsAscending();
             columnOrderingNullsLowMap[i] = columnOrdering[i].getIsNullsOrderedLow();
-
-			if (SanityManager.DEBUG) {
-				isOrderingColumn[columnOrderingMap[i]] = true;
-			}
         }
 
-
 		// No inserter or scan yet.
 		this.inserter = null;
 		this.scan = null;



Mime
View raw message