db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r630643 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile: InsertNode.java ResultSetNode.java UnionNode.java UpdateNode.java
Date Sun, 24 Feb 2008 17:52:36 GMT
Author: djd
Date: Sun Feb 24 09:52:29 2008
New Revision: 630643

URL: http://svn.apache.org/viewvc?rev=630643&view=rev
Log:
Cleanup related to DERBY-3310. Simplify ResultSetNode.genNormalizeResultSetNode to always
work on itself by producing a NormalizeResultSetNode that wraps it. That is how the function
worked and was imlemented.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java?rev=630643&r1=630642&r2=630643&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java Sun
Feb 24 09:52:29 2008
@@ -422,7 +422,7 @@
 		if (! resultColumnList.columnTypesAndLengthsMatch(
 												resultSet.getResultColumns()))
 		{
-			resultSet = resultSet.genNormalizeResultSetNode(resultSet, false);
+			resultSet = resultSet.genNormalizeResultSetNode(false);
 			resultColumnList.copyTypesAndLengthsToSource(resultSet.getResultColumns());
 		}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java?rev=630643&r1=630642&r2=630643&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java Sun
Feb 24 09:52:29 2008
@@ -821,12 +821,10 @@
 	ResultSetNode genProjectRestrictForReordering()
 				throws StandardException
 	{
-		ResultColumnList	prRCList;
-
 		/* We get a shallow copy of the ResultColumnList and its 
 		 * ResultColumns.  (Copy maintains ResultColumn.expression for now.)
 		 */
-		prRCList = resultColumns;
+        ResultColumnList prRCList = resultColumns;
 		resultColumns = resultColumns.copyListAndObjects();
 
 		/* Replace ResultColumn.expression with new VirtualColumnNodes
@@ -1344,12 +1342,10 @@
 	public ResultSetNode genProjectRestrict()
 				throws StandardException
 	{
-		ResultColumnList	prRCList;
-
 		/* We get a shallow copy of the ResultColumnList and its 
 		 * ResultColumns.  (Copy maintains ResultColumn.expression for now.)
 		 */
-		prRCList = resultColumns;
+        ResultColumnList prRCList = resultColumns;
 		resultColumns = resultColumns.copyListAndObjects();
 
 		/* Replace ResultColumn.expression with new VirtualColumnNodes
@@ -1401,7 +1397,7 @@
 	}
 
 	/** 
-	 * Put a NormalizeResultSetNode on top of the specified ResultSetNode.
+	 * Put a NormalizeResultSetNode on top of this ResultSetNode.
 	 * ColumnReferences must continue to point to the same ResultColumn, so
 	 * that ResultColumn must percolate up to the new PRN.  However,
 	 * that ResultColumn will point to a new expression, a VirtualColumnNode, 
@@ -1418,7 +1414,6 @@
 	 * sort has to agree with what the sort expects.
 	 * (insert into t1 (smallintcol) values 1 union all values 2;
 	 *
-	 * @param normalizeChild	Child result set for new NRSN.
 	 * @param forUpdate			If the normalize result set is being used as a
 	 * child for an update statement, then this is true. 
 	 *
@@ -1428,18 +1423,14 @@
 	 * @see NormalizeResultSetNode#init
 	 */
 
-	public NormalizeResultSetNode 
-		genNormalizeResultSetNode(ResultSetNode	normalizeChild, 
-								  boolean forUpdate)
+	NormalizeResultSetNode 
+		genNormalizeResultSetNode(boolean forUpdate)
 				throws StandardException
 	{
-		NormalizeResultSetNode	nrsn;
-		ResultColumnList		prRCList;
-
 		/* We get a shallow copy of the ResultColumnList and its 
 		 * ResultColumns.  (Copy maintains ResultColumn.expression for now.)
 		 */
-		prRCList = resultColumns;
+        ResultColumnList prRCList = resultColumns;
 		resultColumns = resultColumns.copyListAndObjects();
 
 		// Remove any columns that were generated.
@@ -1453,16 +1444,17 @@
 
 		
 		/* Finally, we create the new NormalizeResultSetNode */
-		nrsn = (NormalizeResultSetNode) getNodeFactory().getNode(
+        NormalizeResultSetNode nrsn =
+            (NormalizeResultSetNode) getNodeFactory().getNode(
 								C_NodeTypes.NORMALIZE_RESULT_SET_NODE,
-								normalizeChild,
+								this,
 								prRCList,
 								null, new Boolean(forUpdate),
 								getContextManager());
 		// Propagate the referenced table map if it's already been created
-		if (normalizeChild.getReferencedTableMap() != null)
+		if (getReferencedTableMap() != null)
 		{
-			nrsn.setReferencedTableMap((JBitSet) normalizeChild.getReferencedTableMap().clone());
+			nrsn.setReferencedTableMap((JBitSet) getReferencedTableMap().clone());
 		}
 		return nrsn;
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java?rev=630643&r1=630642&r2=630643&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java Sun Feb
24 09:52:29 2008
@@ -410,7 +410,7 @@
 			 */
 			if (! columnTypesAndLengthsMatch())
 			{
-				treeTop = genNormalizeResultSetNode(this, false);	
+				treeTop = genNormalizeResultSetNode(false);	
 			}
 
 			treeTop = (ResultSetNode) getNodeFactory().getNode(

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java?rev=630643&r1=630642&r2=630643&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java Sun
Feb 24 09:52:29 2008
@@ -548,7 +548,7 @@
 		 */
 		if (! resultColumnList.columnTypesAndLengthsMatch())
  		{
-			resultSet = resultSet.genNormalizeResultSetNode(resultSet, true);
+			resultSet = resultSet.genNormalizeResultSetNode(true);
 			resultColumnList.copyTypesAndLengthsToSource(resultSet.getResultColumns());
 								
  			if (hasCheckConstraints(dataDictionary, targetTableDescriptor))



Mime
View raw message