db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r960783 - in /db/derby/code/branches/10.5: ./ java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java
Date Tue, 06 Jul 2010 04:55:30 GMT
Author: mikem
Date: Tue Jul  6 04:55:29 2010
New Revision: 960783

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

merged change #885659 from trunk to 10.5.

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/branches/10.5/   (props changed)
    db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java
    db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java

Propchange: db/derby/code/branches/10.5/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul  6 04:55:29 2010
@@ -1,2 +1,2 @@
 /db/derby/code/branches/10.6:957000
-/db/derby/code/trunk:757811,769596,769602,769606,769962,772090,772337,772449,772534,774281,777105,779681,782991,785131,785139,785163,785570,785662,788369,788670,788674,788968,789264,790218,791027,792434,793089,793588,794106,794303,794955,795166,795459,796020,796027,796316,796372,797147,798347,798742,800523,803548,803948,805696,808494,808850,809643,810860,812669,816531,816536,819006,822289,823659,824694,829022,829410,831304,831319,832379,833430,835286,881074,881444,882732,884163,885421,887246,892912,897161,898635,901165,901648,901760,903108,908418,909176,911315,915733,916075,916897,918359,921028,927430,928065,942286,942476,942480,942587,946794,948045,948069,951346,954748,955001,955634,956075,956445,956659,958163,959550
+/db/derby/code/trunk:757811,769596,769602,769606,769962,772090,772337,772449,772534,774281,777105,779681,782991,785131,785139,785163,785570,785662,788369,788670,788674,788968,789264,790218,791027,792434,793089,793588,794106,794303,794955,795166,795459,796020,796027,796316,796372,797147,798347,798742,800523,803548,803948,805696,808494,808850,809643,810860,812669,816531,816536,819006,822289,823659,824694,829022,829410,831304,831319,832379,833430,835286,881074,881444,882732,884163,885421,885659,887246,892912,897161,898635,901165,901648,901760,903108,908418,909176,911315,915733,916075,916897,918359,921028,927430,928065,942286,942476,942480,942587,946794,948045,948069,951346,954748,955001,955634,956075,956445,956659,958163,959550

Modified: db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java?rev=960783&r1=960782&r2=960783&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java
(original)
+++ db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java
Tue Jul  6 04:55:29 2010
@@ -168,12 +168,7 @@ public class BasicSortObserver implement
 		{
 			// 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/branches/10.5/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java?rev=960783&r1=960782&r2=960783&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java
(original)
+++ db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java
Tue Jul  6 04:55:29 2010
@@ -126,12 +126,6 @@ class MergeSort implements Sort
 	**/
 	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 @@ class MergeSort implements Sort
                 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 @@ class MergeSort implements Sort
         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