db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r935336 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/execute/ testing/org/apache/derbyTesting/functionTests/tests/jdbc4/
Date Sun, 18 Apr 2010 12:56:59 GMT
Author: kristwaa
Date: Sun Apr 18 12:56:58 2010
New Revision: 935336

URL: http://svn.apache.org/viewvc?rev=935336&view=rev
Log:
DERBY-3650: internal multiple references from different rows to a single BLOB/CLOB stream
leads to various errors when second reference used.

Clone DVDs during joins if their value is represented as a (store) stream.
Enable tests as part of the regression suite.

Origial patch contributed by Mike Matrigali (mikem_app at sbcglobal dot net),
reworked by Kristian Waagan (Kristian dot Waagan at Sun dot com).

Patch file: derby-3650-preliminary_2_reworked-1b.diff

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MergeJoinResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NestedLoopJoinResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NestedLoopLeftOuterJoinResultSet.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/_Suite.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MergeJoinResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MergeJoinResultSet.java?rev=935336&r1=935335&r2=935336&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MergeJoinResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/MergeJoinResultSet.java
Sun Apr 18 12:56:58 2010
@@ -254,15 +254,25 @@ class MergeJoinResultSet extends JoinRes
 		for (colInCtr = 1, colOutCtr = 1; colInCtr <= leftNumCols;
 			 colInCtr++, colOutCtr++)
 		{
-				 mergedRow.setColumn(colOutCtr, 
-									 leftRow.getColumn(colInCtr));
+            DataValueDescriptor src_col = leftRow.getColumn(colInCtr);
+            // Clone the value if it is represented by a stream (DERBY-3650).
+            if (src_col != null && src_col.hasStream()) {
+                src_col = src_col.cloneValue(false);
+            }
+
+            mergedRow.setColumn(colOutCtr, src_col);
 		}
 
 		for (colInCtr = 1; colInCtr <= rightNumCols; 
 			 colInCtr++, colOutCtr++)
 		{
-				 mergedRow.setColumn(colOutCtr, 
-									 rightRow.getColumn(colInCtr));
+            DataValueDescriptor src_col = rightRow.getColumn(colInCtr);
+            // Clone the value if it is represented by a stream (DERBY-3650).
+            if (src_col != null && src_col.hasStream()) {
+                src_col = src_col.cloneValue(false);
+            }
+
+            mergedRow.setColumn(colOutCtr, src_col);
 		}
 
 		setCurrentRow(mergedRow);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NestedLoopJoinResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NestedLoopJoinResultSet.java?rev=935336&r1=935335&r2=935336&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NestedLoopJoinResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NestedLoopJoinResultSet.java
Sun Apr 18 12:56:58 2010
@@ -179,17 +179,31 @@ class NestedLoopJoinResultSet extends Jo
 
 				for (colInCtr = 1, colOutCtr = 1; colInCtr <= leftNumCols;
 					 colInCtr++, colOutCtr++)
-					{
-						 mergedRow.setColumn(colOutCtr, 
-											 leftRow.getColumn(colInCtr));
-					}
+                {
+                    DataValueDescriptor src_col = leftRow.getColumn(colInCtr);
+                    // Clone the value if it is represented by a stream
+                    // (DERBY-3650).
+                    if (src_col != null && src_col.hasStream()) {
+                        src_col = src_col.cloneValue(false);
+                    }
+
+                    mergedRow.setColumn(colOutCtr, src_col);
+                }
+
 				if (! notExistsRightSide)
 				{
 					for (colInCtr = 1; colInCtr <= rightNumCols; 
 						 colInCtr++, colOutCtr++)
 					{
-						 mergedRow.setColumn(colOutCtr, 
-											 rightRow.getColumn(colInCtr));
+                        DataValueDescriptor src_col = 
+                            rightRow.getColumn(colInCtr);
+                        // Clone the value if it is represented by a stream
+                        // (DERBY-3650).
+                        if (src_col != null && src_col.hasStream()) {
+                            src_col = src_col.cloneValue(false);
+                        }
+
+                        mergedRow.setColumn(colOutCtr, src_col);
 					}
 				}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NestedLoopLeftOuterJoinResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NestedLoopLeftOuterJoinResultSet.java?rev=935336&r1=935335&r2=935336&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NestedLoopLeftOuterJoinResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NestedLoopLeftOuterJoinResultSet.java
Sun Apr 18 12:56:58 2010
@@ -223,14 +223,24 @@ class NestedLoopLeftOuterJoinResultSet e
 		for (colInCtr = 1, colOutCtr = 1; colInCtr <= leftNumCols;
 			 colInCtr++, colOutCtr++)
 		{
-			 mergedRow.setColumn(colOutCtr, 
-								 leftRow.getColumn(colInCtr));
+            DataValueDescriptor src_col = leftRow.getColumn(colInCtr);
+            // Clone the value if it is represented by a stream (DERBY-3650).
+            if (src_col != null && src_col.hasStream()) {
+                src_col = src_col.cloneValue(false);
+            }
+
+            mergedRow.setColumn(colOutCtr, src_col);
 		}
 		for (colInCtr = 1; colInCtr <= rightNumCols; 
 			 colInCtr++, colOutCtr++)
 		{
-			 mergedRow.setColumn(colOutCtr, 
-								 rightRow.getColumn(colInCtr));
+            DataValueDescriptor src_col = rightRow.getColumn(colInCtr);
+            // Clone the value if it is represented by a stream (DERBY-3650).
+            if (src_col != null && src_col.hasStream()) {
+                src_col = src_col.cloneValue(false);
+            }
+
+            mergedRow.setColumn(colOutCtr, src_col);
 		}
 	}
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/_Suite.java?rev=935336&r1=935335&r2=935336&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/_Suite.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/_Suite.java
Sun Apr 18 12:56:58 2010
@@ -73,6 +73,7 @@ public class _Suite extends BaseTestCase
         suite.addTest(LobSortTest.suite());
         suite.addTest (BlobSetMethodsTest.suite());
         suite.addTest (JDBC4FromJDBC3DataSourceTest.suite());
+        suite.addTest(Derby3650Test.suite());
 		
 		return suite;
 	}



Mime
View raw message