db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r372692 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/sql/execute/ impl/sql/compile/ impl/sql/execute/
Date Fri, 27 Jan 2006 01:25:57 GMT
Author: djd
Date: Thu Jan 26 17:25:49 2006
New Revision: 372692

URL: http://svn.apache.org/viewcvs?rev=372692&view=rev
Log:
DERBY-766 Modify ResultSetFactory getXXXResultSet methods to not pass in an
Activation if it is available through a passed in source ResultSet. Reduces the
amount of code generated for queries.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/HashTableNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IndexToBaseRowNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java?rev=372692&r1=372691&r2=372692&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java
Thu Jan 26 17:25:49 2006
@@ -209,12 +209,10 @@
      * @param source the result set from which to take rows to be 
      *               updated in the target table.
      * @param vtiRS the updateable result set for the VTI
-     * @param activation the activation for this result set
      * @return the update operation as a result set.
      * @exception StandardException thrown on error
 	 */
-	public ResultSet getUpdateVTIResultSet(NoPutResultSet source,
-                                           Activation activation)
+	public ResultSet getUpdateVTIResultSet(NoPutResultSet source)
         throws StandardException;
 
 	/**
@@ -321,10 +319,6 @@
 
 		@param source the result set from which to take rows to be 
 			filtered by this operation.
-		@param activation the activation for this result set,
-			against whcih the restriction and projection are performed
-			and to which current rows must be assigned for the
-			projection and restriction to be performed.
 		@param singleTableRestriction restriction, if any, applied to
 			input of hash table.
 		@param equijoinQualifiers Qualifier[] for look up into hash table
@@ -352,7 +346,7 @@
 			result set
 	 */
 	public NoPutResultSet getHashTableResultSet(NoPutResultSet source,
-		Activation activation, GeneratedMethod singleTableRestriction, 
+		GeneratedMethod singleTableRestriction, 
 		Qualifier[][] equijoinQualifiers,
 		GeneratedMethod projection, int resultSetNumber,
 		int mapRefItem,
@@ -382,8 +376,6 @@
 		@param distinct true if distinct SELECT list
 		@param isInSortedOrder	true if the source result set is in sorted order
 		@param orderItem entry in preparedStatement's savedObjects for order
-		@param activation the activation for this result set,
-			against which the sort-unique is performed.
 		@param rowAllocator a reference to a method in the activation
 			that generates rows of the right size and shape for the source
 		@param rowSize the size of the row that is allocated by rowAllocator.
@@ -402,7 +394,6 @@
 		boolean distinct, 
 		boolean isInSortedOrder,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int rowSize,
 		int resultSetNumber, 
@@ -420,8 +411,6 @@
 		@param isInSortedOrder	true if the source result set is in sorted order
 		@param aggregateItem entry in preparedStatement's savedObjects for aggregates
 		@param orderingItem		Ignored to allow same signature as getDistinctScalarAggregateResultSet
-		@param activation the activation for this result set,
-			against which the sort-unique is performed.
 		@param rowAllocator a reference to a method in the activation
 			that generates rows of the right size and shape for the source
 		@param rowSize			Ignored to allow same signature as getDistinctScalarAggregateResultSet
@@ -439,7 +428,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderingItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int rowSize,
 		int resultSetNumber, 
@@ -459,8 +447,6 @@
 		@param isInSortedOrder	true if the source result set is in sorted order
 		@param aggregateItem entry in preparedStatement's savedObjects for aggregates
 		@param orderItem entry in preparedStatement's savedObjects for order
-		@param activation the activation for this result set,
-			against which the sort-unique is performed.
 		@param rowAllocator a reference to a method in the activation
 			that generates rows of the right size and shape for the source
 		@param rowSize the size of the row that is allocated by rowAllocator.
@@ -480,7 +466,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderingItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int rowSize,
 		int resultSetNumber, 
@@ -499,8 +484,6 @@
 		@param isInSortedOrder	true if the source result set is in sorted order
 		@param aggregateItem entry in preparedStatement's savedObjects for aggregates
 		@param orderingItem		Ignored to allow same signature as getDistinctScalarAggregateResultSet
-		@param activation the activation for this result set,
-			against which the sort-unique is performed.
 		@param rowAllocator a reference to a method in the activation
 			that generates rows of the right size and shape for the source
 		@param rowSize			Ignored to allow same signature as getDistinctScalarAggregateResultSet
@@ -517,7 +500,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderingItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int rowSize,
 		int resultSetNumber, 
@@ -536,8 +518,6 @@
 		@param isInSortedOrder	true if the source result set is in sorted order
 		@param aggregateItem entry in preparedStatement's savedObjects for aggregates
 		@param orderItem entry in preparedStatement's savedObjects for order
-		@param activation the activation for this result set,
-			against which the sort-unique is performed.
 		@param rowAllocator a reference to a method in the activation
 			that generates rows of the right size and shape for the source
 		@param rowSize the size of the row that is allocated by rowAllocator.
@@ -556,7 +536,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderingItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int rowSize,
 		int resultSetNumber, 
@@ -704,10 +683,10 @@
 		The rows are put into the hash table on the 1st open.
 		<p>
 
-		@param conglomId the conglomerate of the table to be scanned.
-		@param scociItem The saved item for the static conglomerate info.
 		@param activation the activation for this result set,
 			which provides the context for the row allocation operation.
+		@param conglomId the conglomerate of the table to be scanned.
+		@param scociItem The saved item for the static conglomerate info.
 		@param resultRowAllocator a reference to a method in the activation
 			that creates a holder for the rows from the scan.
 			<verbatim>
@@ -761,9 +740,9 @@
 			result set
 	 */
 	NoPutResultSet getHashScanResultSet(
+			                    Activation activation,
 								long conglomId,
-								int scociItem,
-								Activation activation,
+								int scociItem,						
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
 								GeneratedMethod startKeyGetter,
@@ -797,10 +776,10 @@
 		the scan.
 		<p>
 
-		@param conglomId the conglomerate of the table to be scanned.
-		@param scociItem The saved item for the static conglomerate info.
 		@param activation the activation for this result set,
 			which provides the context for the row allocation operation.
+		@param conglomId the conglomerate of the table to be scanned.
+		@param scociItem The saved item for the static conglomerate info.
 		@param resultRowAllocator a reference to a method in the activation
 			that creates a holder for the rows from the scan.
 			<verbatim>
@@ -829,9 +808,9 @@
 			result set
 	 */
 	NoPutResultSet getDistinctScanResultSet(
+			                    Activation activation,
 								long conglomId,
-								int scociItem,
-								Activation activation,
+								int scociItem,			
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
 								int hashKeyColumn,
@@ -913,9 +892,9 @@
 			result set
 	 */
 	NoPutResultSet getTableScanResultSet(
+			                    Activation activation,
 								long conglomId,
 								int scociItem,
-								Activation activation,
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
 								GeneratedMethod startKeyGetter,
@@ -1006,9 +985,9 @@
 			result set
 	 */
 	NoPutResultSet getBulkTableScanResultSet(
+			                    Activation activation,
 								long conglomId,
 								int scociItem,
-								Activation activation,
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
 								GeneratedMethod startKeyGetter,
@@ -1041,8 +1020,6 @@
 
 	    @param conglomId	Conglomerate # for the heap.
 		@param scociItem The saved item for the static conglomerate info.
-		@param activation the activation for this result set,
-			which provides the context for the row allocation operation.
 		@param source	the source result set, which is expected to provide
 						rows from an index conglomerate
 		@param resultRowAllocator a reference to a method in the activation
@@ -1074,7 +1051,6 @@
 	public NoPutResultSet getIndexRowToBaseRowResultSet(
 								long conglomId,
 								int scoci,
-								Activation a,
 								NoPutResultSet source,
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
@@ -1103,8 +1079,6 @@
 		@param leftNumCols		Number of columns in the leftResultSet
 		@param rightResultSet	Inner ResultSet for join.
 		@param rightNumCols		Number of columns in the rightResultSet
-		@param activation the activation for this result set,
-			which provides the context for the row allocation operation.
 		@param joinClause a reference to a method in the activation
 			that is applied to the activation's "current row" field
 			to determine whether the joinClause is satisfied or not.
@@ -1130,7 +1104,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation, 
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   boolean oneRowRightSide,
@@ -1148,8 +1121,6 @@
 		@param leftNumCols		Number of columns in the leftResultSet
 		@param rightResultSet	Inner ResultSet for join.
 		@param rightNumCols		Number of columns in the rightResultSet
-		@param activation the activation for this result set,
-			which provides the context for the row allocation operation.
 		@param joinClause a reference to a method in the activation
 			that is applied to the activation's "current row" field
 			to determine whether the joinClause is satisfied or not.
@@ -1175,7 +1146,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation, 
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   boolean oneRowRightSide,
@@ -1201,8 +1171,6 @@
 		@param leftNumCols		Number of columns in the leftResultSet
 		@param rightResultSet	Inner ResultSet for join.
 		@param rightNumCols		Number of columns in the rightResultSet
-		@param activation the activation for this result set,
-			which provides the context for the row allocation operation.
 		@param joinClause a reference to a method in the activation
 			that is applied to the activation's "current row" field
 			to determine whether the joinClause is satisfied or not.
@@ -1231,7 +1199,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation, 
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   GeneratedMethod emptyRowFun,
@@ -1251,8 +1218,6 @@
 		@param leftNumCols		Number of columns in the leftResultSet
 		@param rightResultSet	Inner ResultSet for join.
 		@param rightNumCols		Number of columns in the rightResultSet
-		@param activation the activation for this result set,
-			which provides the context for the row allocation operation.
 		@param joinClause a reference to a method in the activation
 			that is applied to the activation's "current row" field
 			to determine whether the joinClause is satisfied or not.
@@ -1281,7 +1246,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation, 
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   GeneratedMethod emptyRowFun,
@@ -1516,10 +1480,10 @@
 		on the scan of its parent table and if the row being deleted
 		on parent table has a reference in the dependent table.
 
-		@param conglomId the conglomerate of the table to be scanned.
-		@param scociItem The saved item for the static conglomerate info.
 		@param activation the activation for this result set,
 			which provides the context for the row allocation operation.
+		@param conglomId the conglomerate of the table to be scanned.
+		@param scociItem The saved item for the static conglomerate info.
 		@param resultRowAllocator a reference to a method in the activation
 			that creates a holder for the result row of the scan.  May
 			be a partial row.
@@ -1577,9 +1541,9 @@
 			result set
 	 */
 	public NoPutResultSet getRaDependentTableScanResultSet(
+			                        Activation activation,
 									long conglomId,
-									int scociItem,
-									Activation activation,
+									int scociItem,							
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									GeneratedMethod startKeyGetter,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java?rev=372692&r1=372691&r2=372692&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseJoinStrategy.java
Thu Jan 26 17:25:49 2006
@@ -49,8 +49,8 @@
 
 import org.apache.derby.iapi.util.PropertyUtil;
 
-abstract public class BaseJoinStrategy implements JoinStrategy {
-	public BaseJoinStrategy() {
+abstract class BaseJoinStrategy implements JoinStrategy {
+	BaseJoinStrategy() {
 	}
 
 	/** @see JoinStrategy#bulkFetchOK */
@@ -63,7 +63,25 @@
 		return false;
 	}
 
-	protected void fillInScanArgs1(
+	/**
+	 * Push the first set of common arguments for obtaining a scan ResultSet from
+	 * ResultSetFactory.
+	 * The first 11 arguments are common for these ResultSet getters
+	 * <UL>
+	 * <LI> ResultSetFactory.getBulkTableScanResultSet
+	 * <LI> ResultSetFactory.getHashScanResultSet
+	 * <LI> ResultSetFactory.getTableScanResultSet
+	 * <LI> ResultSetFactory.getRaDependentTableScanResultSet
+	 * </UL>
+	 * @param tc
+	 * @param mb
+	 * @param innerTable
+	 * @param predList
+	 * @param acbi
+	 * @param resultRowAllocator
+	 * @throws StandardException
+	 */
+	void fillInScanArgs1(
 								TransactionController tc,
 								MethodBuilder mb,
 								Optimizable innerTable,
@@ -80,9 +98,9 @@
 										getConglomerateNumber();
 		StaticCompiledOpenConglomInfo scoci = tc.getStaticCompiledConglomInfo(conglomNumber);
 		
+		acb.pushThisAsActivation(mb);
 		mb.push(conglomNumber);
 		mb.push(acb.addItem(scoci));
-		acb.pushThisAsActivation(mb);
 
 		acb.pushMethodReference(mb, resultRowAllocator);
 		mb.push(innerTable.getResultSetNumber());
@@ -103,7 +121,7 @@
 		mb.upCast(ClassName.Qualifier + "[][]");
 	}
 
-	protected void fillInScanArgs2(MethodBuilder mb,
+	final void fillInScanArgs2(MethodBuilder mb,
 								Optimizable innerTable,
 								int bulkFetch,
 								int colRefItem,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java?rev=372692&r1=372691&r2=372692&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java Thu
Jan 26 17:25:49 2006
@@ -322,12 +322,11 @@
 		 *  arg2: distinct - true, of course
 		 *  arg3: isInSortedOrder - is the source result set in sorted order
 		 *  arg4: orderItem - entry in saved objects for the ordering
-		 *  arg5: Activation
-		 *  arg6: rowAllocator - method to construct rows for fetching
+		 *  arg5: rowAllocator - method to construct rows for fetching
 		 *			from the sort
-		 *  arg7: row size
-		 *  arg8: resultSetNumber
-		 *  arg9: closeCleanup
+		 *  arg6: row size
+		 *  arg7: resultSetNumber
+		 *  arg8: closeCleanup
 		 */
 
 		acb.pushGetResultSetFactoryExpression(mb);
@@ -336,7 +335,6 @@
 		mb.push(true);
 		mb.push(inSortedOrder);
 		mb.push(orderItem);
-		acb.pushThisAsActivation(mb);
 		resultColumns.generateHolder(acb, mb);
 		mb.push(resultColumns.getTotalColumnSize());
 		mb.push(resultSetNumber);
@@ -344,6 +342,6 @@
 		mb.push(costEstimate.getEstimatedCost());
 		closeMethodArgument(acb, mb);
 
-		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getSortResultSet", ClassName.NoPutResultSet,
11);
+		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getSortResultSet", ClassName.NoPutResultSet,
10);
 	}
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java?rev=372692&r1=372691&r2=372692&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java Thu
Jan 26 17:25:49 2006
@@ -3218,10 +3218,10 @@
 
 		acb.pushGetResultSetFactoryExpression(mb);
 
+     	acb.pushThisAsActivation(mb);
 		mb.push(conglomNumber);
 		mb.push(acb.addItem(scoci));
-      	acb.pushThisAsActivation(mb);
-		resultColumns.generateHolder(acb, mb, referencedCols, (FormatableBitSet) null);
+ 		resultColumns.generateHolder(acb, mb, referencedCols, (FormatableBitSet) null);
 		mb.push(getResultSetNumber());
 		mb.push(hashKeyItem);
 		mb.push(tableDescriptor.getName());

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java?rev=372692&r1=372691&r2=372692&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java Thu
Jan 26 17:25:49 2006
@@ -852,7 +852,6 @@
 		mb.push(isInSortedOrder);
 		mb.push(aggInfoItem);
 		mb.push(orderingItem);
-		acb.pushThisAsActivation(mb);
 
 		resultColumns.generateHolder(acb, mb);
 
@@ -899,7 +898,7 @@
 
 		closeMethodArgument(acb, mb);
 
-		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, resultSet, ClassName.NoPutResultSet,
12);
+		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, resultSet, ClassName.NoPutResultSet,
11);
 	}
 
 	/**
@@ -929,7 +928,7 @@
 
 		closeMethodArgument(acb, mb);
 
-		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, resultSet, ClassName.NoPutResultSet,
11);
+		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, resultSet, ClassName.NoPutResultSet,
10);
 
 	}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/HashTableNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/HashTableNode.java?rev=372692&r1=372691&r2=372692&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/HashTableNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/HashTableNode.java Thu
Jan 26 17:25:49 2006
@@ -270,22 +270,21 @@
 
 		/* Generate the HashTableResultSet:
 		 *	arg1: childExpress - Expression for childResultSet
-		 *  arg2: Activation
-		 *  arg3: searchExpress - Expression for single table predicates
-		 *	arg4	: equijoinExpress - Qualifier[] for hash table look up
-		 *  arg5: projectExpress - Expression for projection, if any
-		 *  arg6: resultSetNumber
-		 *  arg7: mapArrayItem - item # for mapping of source columns
-		 *  arg8: reuseResult - whether or not the result row can be reused
+		 *  arg2: searchExpress - Expression for single table predicates
+		 *	arg3	: equijoinExpress - Qualifier[] for hash table look up
+		 *  arg4: projectExpress - Expression for projection, if any
+		 *  arg5: resultSetNumber
+		 *  arg6: mapArrayItem - item # for mapping of source columns
+		 *  arg7: reuseResult - whether or not the result row can be reused
 		 *						(ie, will it always be the same)
-		 *	arg9: hashKeyItem - item # for int[] of hash column #s
-		 *	arg10: removeDuplicates - don't remove duplicates in hash table (for now)
-		 *	arg11: maxInMemoryRowCount - max row size for in-memory hash table
-		 *	arg12: initialCapacity - initialCapacity for java.util.Hashtable
-		 *	arg13	: loadFactor - loadFactor for java.util.Hashtable
-		 *  arg14: estimated row count
-		 *  arg15: estimated cost
-		 *  arg16: close method
+		 *	arg8: hashKeyItem - item # for int[] of hash column #s
+		 *	arg9: removeDuplicates - don't remove duplicates in hash table (for now)
+		 *	arg10: maxInMemoryRowCount - max row size for in-memory hash table
+		 *	arg11: initialCapacity - initialCapacity for java.util.Hashtable
+		 *	arg12	: loadFactor - loadFactor for java.util.Hashtable
+		 *  arg13: estimated row count
+		 *  arg14: estimated cost
+		 *  arg15: close method
 		 */
 
 		acb.pushGetResultSetFactoryExpression(mb);
@@ -327,7 +326,6 @@
 		{
 			costEstimate = childResult.getCostEstimate();
 		}
-		acb.pushThisAsActivation(mb);
 
 		// if there is no searchClause, we just want to pass null.
 		if (searchClause == null)
@@ -412,7 +410,7 @@
 		mb.push(costEstimate.getEstimatedCost());
 		closeMethodArgument(acb, mb);
 
-		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getHashTableResultSet", ClassName.NoPutResultSet,
16);
+		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getHashTableResultSet", ClassName.NoPutResultSet,
15);
 	}
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IndexToBaseRowNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IndexToBaseRowNode.java?rev=372692&r1=372691&r2=372692&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IndexToBaseRowNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IndexToBaseRowNode.java
Thu Jan 26 17:25:49 2006
@@ -212,7 +212,6 @@
 
 		mb.push(heapConglomNumber);
 		mb.push(acb.addItem(scoci));
-		acb.pushThisAsActivation(mb);
 		source.generate(acb, mb);
 		
 		mb.upCast(ClassName.NoPutResultSet);
@@ -267,7 +266,7 @@
 		closeMethodArgument(acb, mb);
 
 		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getIndexRowToBaseRowResultSet",
-						ClassName.NoPutResultSet, 15);
+						ClassName.NoPutResultSet, 14);
 
 		/* The IndexRowToBaseRowResultSet generator is what we return */
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java?rev=372692&r1=372691&r2=372692&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/JoinNode.java Thu Jan
26 17:25:49 2006
@@ -1576,7 +1576,6 @@
 		mb.push(leftResultSet.resultColumns.size()); // arg 2
 		rightResultSet.generate(acb, mb); // arg 3
 		mb.push(rightResultSet.resultColumns.size()); // arg 4
-		acb.pushThisAsActivation(mb); // arg 5
 
 		// Get the cost estimate if we don't have one yet
 		if (costEstimate == null)
@@ -1608,7 +1607,7 @@
 		// if there is no join clause, we just pass a null Expression.
 		if (joinClause == null)
 		{
-		   	mb.pushNull(ClassName.GeneratedMethod); // arg 6
+		   	mb.pushNull(ClassName.GeneratedMethod); // arg 5
 		}
 		else
 		{
@@ -1635,10 +1634,10 @@
 			//	ActivationClass.userExprFun
 			// which is the static field that "points" to the userExprFun
 			// that evaluates the where clause.
-   			acb.pushMethodReference(mb, userExprFun); // arg 6
+   			acb.pushMethodReference(mb, userExprFun); // arg 5
 		}
 
-		mb.push(resultSetNumber); // arg 7
+		mb.push(resultSetNumber); // arg 6
 
 		addOuterJoinArguments(acb, mb);
 
@@ -1679,7 +1678,7 @@
 	 */
 	protected int getNumJoinArguments()
 	{
-		return 13;
+		return 12;
 	}
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java?rev=372692&r1=372691&r2=372692&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OrderByList.java Thu
Jan 26 17:25:49 2006
@@ -366,14 +366,13 @@
 		 *				for distincts
 		 *  arg3: isInSortedOrder - is the source result set in sorted order
 		 *  arg4: orderItem - entry in saved objects for the ordering
-		 *  arg5: Activation
-		 *  arg6: rowAllocator - method to construct rows for fetching
+		 *  arg5: rowAllocator - method to construct rows for fetching
 		 *			from the sort
-		 *  arg7: row size
-		 *  arg8: resultSetNumber
-		 *  arg9: estimated row count
-		 *  arg10: estimated cost
-		 *  arg11: closeCleanup
+		 *  arg6: row size
+		 *  arg7: resultSetNumber
+		 *  arg8: estimated row count
+		 *  arg9: estimated cost
+		 *  arg10: closeCleanup
 		 */
 
 		acb.pushGetResultSetFactoryExpression(mb);
@@ -390,8 +389,6 @@
 
 		mb.push(orderItem);
 
-		acb.pushThisAsActivation(mb);
-
 		// row allocator
 		child.getResultColumns().generateHolder(acb, mb);
 
@@ -415,7 +412,7 @@
 		acb.pushResultSetClosedMethodFieldAccess(mb);
 
 		mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getSortResultSet",
-							ClassName.NoPutResultSet, 11);
+							ClassName.NoPutResultSet, 10);
 
 	}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java?rev=372692&r1=372691&r2=372692&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 Thu
Jan 26 17:25:49 2006
@@ -771,8 +771,7 @@
 
 		/*
 		** Generate the update result set, giving it either the original
-		** source or the normalize result set, the constant action,
-		** and "this".
+		** source or the normalize result set, the constant action.
 		*/
 
 		acb.pushGetResultSetFactoryExpression(mb);
@@ -781,8 +780,7 @@
         if( null != targetVTI)
         {
 			targetVTI.assignCostEstimate(resultSet.getNewCostEstimate());
-            acb.pushThisAsActivation(mb); // arg 2
-            mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getUpdateVTIResultSet",
ClassName.ResultSet, 2);
+            mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getUpdateVTIResultSet",
ClassName.ResultSet, 1);
 		}
         else
         {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java?rev=372692&r1=372691&r2=372692&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
Thu Jan 26 17:25:49 2006
@@ -182,10 +182,10 @@
 		@see ResultSetFactory#getUpdateVTIResultSet
 		@exception StandardException thrown on error
 	 */
-	public ResultSet getUpdateVTIResultSet(NoPutResultSet source,
-                                           Activation activation)
+	public ResultSet getUpdateVTIResultSet(NoPutResultSet source)
 			throws StandardException
 	{
+		Activation activation = source.getActivation();
 		getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
 		return new UpdateVTIResultSet(source, activation);
 	}
@@ -252,7 +252,7 @@
 		@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getHashTableResultSet(NoPutResultSet source,
-		Activation activation, GeneratedMethod singleTableRestriction, 
+		GeneratedMethod singleTableRestriction, 
 		Qualifier[][] equijoinQualifiers,
 		GeneratedMethod projection, int resultSetNumber,
 		int mapRefItem,
@@ -267,7 +267,7 @@
 		GeneratedMethod closeCleanup)
 			throws StandardException
 	{
-		return new HashTableResultSet(source, activation, 
+		return new HashTableResultSet(source, source.getActivation(), 
 			singleTableRestriction, 
             equijoinQualifiers,
 			projection, resultSetNumber, 
@@ -291,7 +291,6 @@
 		boolean distinct, 
 		boolean isInSortedOrder,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int maxRowSize,
 		int resultSetNumber, 
@@ -304,7 +303,7 @@
 			distinct, 
 			isInSortedOrder,
 			orderItem,
-			activation, 
+			source.getActivation(), 
 			rowAllocator, 
 			maxRowSize,
 			resultSetNumber, 
@@ -321,7 +320,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int maxRowSize,
 		int resultSetNumber, 
@@ -332,7 +330,7 @@
 			throws StandardException
 	{
 		return new ScalarAggregateResultSet(
-						source, isInSortedOrder, aggregateItem, activation,
+						source, isInSortedOrder, aggregateItem, source.getActivation(),
 						rowAllocator, resultSetNumber, singleInputRow,
 						optimizerEstimatedRowCount,
 						optimizerEstimatedCost, closeCleanup);
@@ -346,7 +344,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int maxRowSize,
 		int resultSetNumber, 
@@ -357,7 +354,7 @@
 			throws StandardException
 	{
 		return new DistinctScalarAggregateResultSet(
-						source, isInSortedOrder, aggregateItem, orderItem, activation,
+						source, isInSortedOrder, aggregateItem, orderItem, source.getActivation(),
 						rowAllocator, maxRowSize, resultSetNumber, singleInputRow,
 						optimizerEstimatedRowCount,
 						optimizerEstimatedCost, closeCleanup);
@@ -371,7 +368,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int maxRowSize,
 		int resultSetNumber, 
@@ -381,7 +377,7 @@
 			throws StandardException
 	{
 		return new GroupedAggregateResultSet(
-						source, isInSortedOrder, aggregateItem, orderItem, activation,
+						source, isInSortedOrder, aggregateItem, orderItem, source.getActivation(),
 						rowAllocator, maxRowSize, resultSetNumber, optimizerEstimatedRowCount,
 						optimizerEstimatedCost, closeCleanup);
 	}
@@ -394,7 +390,6 @@
 		boolean isInSortedOrder,
 		int aggregateItem,
 		int orderItem,
-		Activation activation, 
 		GeneratedMethod rowAllocator, 
 		int maxRowSize,
 		int resultSetNumber, 
@@ -404,7 +399,7 @@
 			throws StandardException
 	{
 		return new DistinctGroupedAggregateResultSet(
-						source, isInSortedOrder, aggregateItem, orderItem, activation,
+						source, isInSortedOrder, aggregateItem, orderItem, source.getActivation(),
 						rowAllocator, maxRowSize, resultSetNumber, optimizerEstimatedRowCount,
 						optimizerEstimatedCost, closeCleanup);
 	}
@@ -504,9 +499,9 @@
 		@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getHashScanResultSet(
+                        			Activation activation,
 									long conglomId,
 									int scociItem,
-									Activation activation,
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									GeneratedMethod startKeyGetter,
@@ -576,9 +571,9 @@
 		@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getDistinctScanResultSet(
+                         			Activation activation,
 									long conglomId,
 									int scociItem,
-									Activation activation,
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									int hashKeyColumn,
@@ -623,9 +618,9 @@
 		@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getTableScanResultSet(
+                        			Activation activation,
 									long conglomId,
 									int scociItem,
-									Activation activation,
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									GeneratedMethod startKeyGetter,
@@ -687,9 +682,9 @@
 		@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getBulkTableScanResultSet(
+                       			    Activation activation,
 									long conglomId,
 									int scociItem,
-									Activation activation,
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									GeneratedMethod startKeyGetter,
@@ -760,7 +755,6 @@
 	public NoPutResultSet getIndexRowToBaseRowResultSet(
 								long conglomId,
 								int scociItem,
-								Activation a,
 								NoPutResultSet source,
 								GeneratedMethod resultRowAllocator,
 								int resultSetNumber,
@@ -778,7 +772,7 @@
 		return new IndexRowToBaseRowResultSet(
 								conglomId,
 								scociItem,
-								a,
+								source.getActivation(),
 								source,
 								resultRowAllocator,
 								resultSetNumber,
@@ -802,7 +796,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation,
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   boolean oneRowRightSide,
@@ -815,7 +808,7 @@
 	{
 		return new NestedLoopJoinResultSet(leftResultSet, leftNumCols,
 										   rightResultSet, rightNumCols,
-										   activation, joinClause,
+										   leftResultSet.getActivation(), joinClause,
 										   resultSetNumber, 
 										   oneRowRightSide, 
 										   notExistsRightSide, 
@@ -834,7 +827,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation,
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   boolean oneRowRightSide,
@@ -847,7 +839,7 @@
 	{
 		return new HashJoinResultSet(leftResultSet, leftNumCols,
 										   rightResultSet, rightNumCols,
-										   activation, joinClause,
+										   leftResultSet.getActivation(), joinClause,
 										   resultSetNumber, 
 										   oneRowRightSide, 
 										   notExistsRightSide, 
@@ -866,7 +858,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation,
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   GeneratedMethod emptyRowFun,
@@ -881,7 +872,7 @@
 	{
 		return new NestedLoopLeftOuterJoinResultSet(leftResultSet, leftNumCols,
 										   rightResultSet, rightNumCols,
-										   activation, joinClause,
+										   leftResultSet.getActivation(), joinClause,
 										   resultSetNumber, 
 										   emptyRowFun, 
 										   wasRightOuterJoin,
@@ -902,7 +893,6 @@
 								   int leftNumCols,
 								   NoPutResultSet rightResultSet,
 								   int rightNumCols,
-								   Activation activation,
 								   GeneratedMethod joinClause,
 								   int resultSetNumber,
 								   GeneratedMethod emptyRowFun,
@@ -917,7 +907,7 @@
 	{
 		return new HashLeftOuterJoinResultSet(leftResultSet, leftNumCols,
 										   rightResultSet, rightNumCols,
-										   activation, joinClause,
+										   leftResultSet.getActivation(), joinClause,
 										   resultSetNumber, 
 										   emptyRowFun, 
 										   wasRightOuterJoin,
@@ -1165,9 +1155,9 @@
 	 *	@exception StandardException thrown on error
 	 */
 	public NoPutResultSet getRaDependentTableScanResultSet(
+			                        Activation activation,
 									long conglomId,
 									int scociItem,
-									Activation activation,
 									GeneratedMethod resultRowAllocator,
 									int resultSetNumber,
 									GeneratedMethod startKeyGetter,



Mime
View raw message