You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2005/12/24 23:09:19 UTC
svn commit: r358954 - in /db/derby/code/trunk/java/engine/org/apache/derby:
iapi/sql/ iapi/sql/execute/ impl/sql/compile/ impl/sql/execute/
Author: djd
Date: Sat Dec 24 14:09:13 2005
New Revision: 358954
URL: http://svn.apache.org/viewcvs?rev=358954&view=rev
Log:
DERBY-766 (partial) Remove passing the activation into some ResultSetFactory methods
and instead obtain the activation from the passed in ResultSet. Incremental progess
on removing activations from ResultSetFactory methods.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultSet.java
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/DeleteNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromList.java
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/IntersectOrExceptNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MaterializeResultSetNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NormalizeResultSetNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ProjectRestrictNode.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/SubqueryNode.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
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultSet.java?rev=358954&r1=358953&r2=358954&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultSet.java Sat Dec 24 14:09:13 2005
@@ -95,6 +95,8 @@
* statement.
*/
ResultDescription getResultDescription();
+
+ Activation getActivation();
/**
* Needs to be called before the result set will do anything.
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=358954&r1=358953&r2=358954&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 Sat Dec 24 14:09:13 2005
@@ -109,13 +109,11 @@
@param source the result set from which to take rows to
be inserted into the target table.
@param checkGM The code to enforce the check constraints, if any
- @param activation the activation for this result set,
@return the insert operation as a result set.
@exception StandardException thrown when unable to perform the insert
*/
ResultSet getInsertResultSet(NoPutResultSet source,
- GeneratedMethod checkGM,
- Activation activation)
+ GeneratedMethod checkGM)
throws StandardException;
/**
@@ -127,13 +125,11 @@
@param source the result set from which to take rows to
be inserted into the target table.
@param vtiRS The code to instantiate the VTI, if necessary
- @param activation the activation for this result set,
@return the insert VTI operation as a result set.
@exception StandardException thrown when unable to perform the insert
*/
ResultSet getInsertVTIResultSet(NoPutResultSet source,
- NoPutResultSet vtiRS,
- Activation activation)
+ NoPutResultSet vtiRS)
throws StandardException;
/**
@@ -144,12 +140,10 @@
@param source the result set from which to take rows to
be inserted into the target table.
- @param activation the activation for this result set,
@return the delete VTI operation as a result set.
@exception StandardException thrown when unable to perform the insert
*/
- ResultSet getDeleteVTIResultSet(NoPutResultSet source,
- Activation activation)
+ ResultSet getDeleteVTIResultSet(NoPutResultSet source)
throws StandardException;
/**
@@ -162,12 +156,10 @@
be deleted from the target table. This result set must
contain one column which provides RowLocations that are
valid in the target table.
- @param activation the activation for this result set
@return the delete operation as a result set.
@exception StandardException thrown when unable to perform the delete
*/
- ResultSet getDeleteResultSet(NoPutResultSet source,
- Activation activation)
+ ResultSet getDeleteResultSet(NoPutResultSet source)
throws StandardException;
/**
@@ -178,7 +170,6 @@
@param source the result set from which to take rows to
be deleted from the target table.
- @param activation the activation for this result set
@param constantActionItem a constant action saved object reference
@param dependentResultSets an array of DeleteCascade Resultsets
for the current table referential action
@@ -191,7 +182,7 @@
@exception StandardException thrown when unable to perform the delete
*/
ResultSet getDeleteCascadeResultSet(NoPutResultSet source,
- Activation activation, int constantActionItem,
+ int constantActionItem,
ResultSet[] dependentResultSets,
String resultSetId)
throws StandardException;
@@ -207,13 +198,11 @@
a column which provides RowLocations that are valid in the
target table, and new values to be placed in those rows.
@param checkGM The code to enforce the check constraints, if any
- @param activation the activation for this result set
@return the update operation as a result set.
@exception StandardException thrown when unable to perform the update
*/
ResultSet getUpdateResultSet(NoPutResultSet source,
- GeneratedMethod checkGM,
- Activation activation)
+ GeneratedMethod checkGM)
throws StandardException;
/**
@@ -239,7 +228,6 @@
a column which provides RowLocations that are valid in the
target table, and new values to be placed in those rows.
@param checkGM The code to enforce the check constraints, if any
- @param activation the activation for this result set
@param constantActionItem a constant action saved object reference
@param rsdItem result Description, saved object id.
@return the update operation as a result set.
@@ -247,7 +235,6 @@
*/
ResultSet getDeleteCascadeUpdateResultSet(NoPutResultSet source,
GeneratedMethod checkGM,
- Activation activation,
int constantActionItem,
int rsdItem)
throws StandardException;
@@ -281,10 +268,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 restriction a reference to a method in the activation
that is applied to the activation's "current row" field
to determine whether the restriction is satisfied or not.
@@ -318,7 +301,7 @@
result set
*/
NoPutResultSet getProjectRestrictResultSet(NoPutResultSet source,
- Activation activation, GeneratedMethod restriction,
+ GeneratedMethod restriction,
GeneratedMethod projection, int resultSetNumber,
GeneratedMethod constantRestriction,
int mapArrayItem,
@@ -589,10 +572,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 emptyRowFun a reference to a method in the activation
that is called if the source returns no rows
@param resultSetNumber The resultSetNumber for the ResultSet
@@ -606,7 +585,7 @@
result set
*/
NoPutResultSet getAnyResultSet(NoPutResultSet source,
- Activation activation, GeneratedMethod emptyRowFun, int resultSetNumber,
+ GeneratedMethod emptyRowFun, int resultSetNumber,
int subqueryNumber, int pointOfAttachment,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost)
@@ -620,10 +599,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 emptyRowFun a reference to a method in the activation
that is called if the source returns no rows
@param cardinalityCheck The type of cardinality check, if any that
@@ -639,7 +614,7 @@
result set
*/
NoPutResultSet getOnceResultSet(NoPutResultSet source,
- Activation activation, GeneratedMethod emptyRowFun,
+ GeneratedMethod emptyRowFun,
int cardinalityCheck, int resultSetNumber,
int subqueryNumber, int pointOfAttachment,
double optimizerEstimatedRowCount,
@@ -1309,8 +1284,6 @@
will return results from the temp table.
@param source the result set input to this result set.
- @param activation the activation for this result set,
- which provides the context for normalization.
@param resultSetNumber The resultSetNumber for the ResultSet
@param optimizerEstimatedRowCount Estimated total # of rows by
optimizer
@@ -1320,7 +1293,7 @@
@exception StandardException Thrown on failure
*/
- NoPutResultSet getMaterializedResultSet(NoPutResultSet source, Activation activation,
+ NoPutResultSet getMaterializedResultSet(NoPutResultSet source,
int resultSetNumber,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost,
@@ -1358,8 +1331,6 @@
REMIND: needs more description...
@param source the result set input to this result set.
- @param activation the activation for this result set,
- which provides the context for normalization.
@param resultSetNumber The resultSetNumber for the ResultSet
@param erdNumber int for ResultDescription
(so it can be turned back into an object)
@@ -1372,7 +1343,6 @@
@exception StandardException Thrown on failure
*/
NoPutResultSet getNormalizeResultSet(NoPutResultSet source,
- Activation activation,
int resultSetNumber, int erdNumber,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost,
@@ -1420,7 +1390,6 @@
*/
NoPutResultSet getUnionResultSet(NoPutResultSet source1,
NoPutResultSet source2,
- Activation activation,
int resultSetNumber,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost,
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java?rev=358954&r1=358953&r2=358954&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java Sat Dec 24 14:09:13 2005
@@ -545,30 +545,27 @@
if(cascadeDelete || isDependentTable)
{
resultSetGetter = "getDeleteCascadeResultSet";
+ argCount = 4;
}
else
{
resultSetGetter = "getDeleteResultSet";
+ argCount = 1;
}
- argCount = 2;
+
} else {
- argCount = 2;
+ argCount = 1;
resultSetGetter = "getDeleteVTIResultSet";
}
-
- acb.pushThisAsActivation(mb);
-
if(isDependentTable)
{
- argCount = 3;
mb.push(acb.addItem(makeConstantAction()));
}else
{
if(cascadeDelete)
{
- argCount = 3;
mb.push(-1); //root table.
}
}
@@ -583,8 +580,6 @@
acb.newFieldDeclaration(Modifier.PRIVATE, resultSetArrayType);
mb.pushNewArray(ClassName.ResultSet, dependentNodes.length); // new ResultSet[size]
mb.setField(arrayField);
-
- argCount = 4;
for(int index=0 ; index < dependentNodes.length ; index++)
{
@@ -624,7 +619,6 @@
{
if(isDependentTable)
{
- argCount =4;
mb.pushNull(resultSetArrayType); //No dependent tables for this table
}
}
@@ -634,7 +628,6 @@
{
parentResultSetId = targetTableDescriptor.getSchemaName() +
"." + targetTableDescriptor.getName();
- argCount = 5;
mb.push(parentResultSetId);
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromList.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromList.java?rev=358954&r1=358953&r2=358954&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromList.java Sat Dec 24 14:09:13 2005
@@ -866,16 +866,6 @@
}
/**
- Move the mark for result set being the statement's outermost
- result set down into the first table of the from list.
- Generally expect there is only one table at this point.
- */
- void markStatementResultSet()
- {
- ((FromTable) elementAt(0)).markStatementResultSet();
- }
-
- /**
* Get the FromTable from this list which has the specified ResultColumn in
* its RCL.
*
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java?rev=358954&r1=358953&r2=358954&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 Sat Dec 24 14:09:13 2005
@@ -753,10 +753,7 @@
// arg 2 generate code to evaluate CHECK CONSTRAINTS
generateCheckConstraints( checkConstraints, acb, mb );
- acb.pushThisAsActivation(mb); // arg 3
-
-
- mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getInsertResultSet", ClassName.ResultSet, 3);
+ mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getInsertResultSet", ClassName.ResultSet, 2);
}
else
{
@@ -771,7 +768,6 @@
/*
** Generate the insert VTI result set, giving it either the original
** source or the normalize result set, the constant action,
- ** and "this".
*/
acb.pushGetResultSetFactoryExpression(mb);
@@ -781,9 +777,7 @@
// arg 2
targetVTI.generate(acb, mb);
- acb.pushThisAsActivation(mb); // arg 3
-
- mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getInsertVTIResultSet", ClassName.ResultSet, 3);
+ mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getInsertVTIResultSet", ClassName.ResultSet, 2);
}
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IntersectOrExceptNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IntersectOrExceptNode.java?rev=358954&r1=358953&r2=358954&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IntersectOrExceptNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IntersectOrExceptNode.java Sat Dec 24 14:09:13 2005
@@ -346,7 +346,7 @@
* 11) intermediateOrderByDirection saved object index
*/
- acb.pushGetResultSetFactoryExpression(mb); // instance for getUnionResultSet
+ acb.pushGetResultSetFactoryExpression(mb); // instance for getSetOpResultSet
getLeftResultSet().generate( acb, mb);
getRightResultSet().generate( acb, mb);
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MaterializeResultSetNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MaterializeResultSetNode.java?rev=358954&r1=358953&r2=358954&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MaterializeResultSetNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MaterializeResultSetNode.java Sat Dec 24 14:09:13 2005
@@ -120,13 +120,12 @@
acb.pushGetResultSetFactoryExpression(mb);
childResult.generate(acb, mb);
- acb.pushThisAsActivation(mb);
mb.push(resultSetNumber);
mb.push(costEstimate.rowCount());
mb.push(costEstimate.getEstimatedCost());
closeMethodArgument(acb, mb);
mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getMaterializedResultSet",
- ClassName.NoPutResultSet, 6);
+ ClassName.NoPutResultSet, 5);
}
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NormalizeResultSetNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NormalizeResultSetNode.java?rev=358954&r1=358953&r2=358954&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NormalizeResultSetNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NormalizeResultSetNode.java Sat Dec 24 14:09:13 2005
@@ -120,7 +120,6 @@
acb.pushGetResultSetFactoryExpression(mb);
childResult.generate(acb, mb);
- acb.pushThisAsActivation(mb);
mb.push(resultSetNumber);
mb.push(erdNumber);
mb.push(costEstimate.rowCount());
@@ -128,7 +127,7 @@
mb.push(forUpdate);
closeMethodArgument(acb, mb);
mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getNormalizeResultSet",
- ClassName.NoPutResultSet, 8);
+ ClassName.NoPutResultSet, 7);
}
/**
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ProjectRestrictNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ProjectRestrictNode.java?rev=358954&r1=358953&r2=358954&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ProjectRestrictNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ProjectRestrictNode.java Sat Dec 24 14:09:13 2005
@@ -1307,8 +1307,6 @@
costEstimate = childResult.getFinalCostEstimate();
}
- acb.pushThisAsActivation(mb);
-
// if there is no restriction, we just want to pass null.
if (restriction == null)
{
@@ -1417,7 +1415,7 @@
closeMethodArgument(acb, mb);
mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getProjectRestrictResultSet",
- ClassName.NoPutResultSet, 12);
+ ClassName.NoPutResultSet, 11);
}
/**
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java?rev=358954&r1=358953&r2=358954&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 Sat Dec 24 14:09:13 2005
@@ -1519,7 +1519,6 @@
// instance and first arg are pushed by caller
- acb.pushThisAsActivation(mb);
mb.push(resultSetNumber);
mb.push(erdNumber);
mb.push(getCostEstimate().rowCount());
@@ -1528,7 +1527,7 @@
closeMethodArgument(acb, mb);
mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getNormalizeResultSet",
- ClassName.NoPutResultSet, 8);
+ ClassName.NoPutResultSet, 7);
}
/**
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryNode.java?rev=358954&r1=358953&r2=358954&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryNode.java Sat Dec 24 14:09:13 2005
@@ -1878,8 +1878,6 @@
*/
resultSet.getResultColumns().setResultSetNumber(subqResultSetNumber);
- acb.pushThisAsActivation(mb);
-
/* Generate code for empty row */
resultSet.getResultColumns().generateNulls(acb, mb);
@@ -1921,10 +1919,10 @@
* unique value
*/
mb.push(cardinalityCheck);
- nargs = 9;
+ nargs = 8;
} else {
- nargs = 8;
+ nargs = 7;
}
mb.push(subqResultSetNumber);
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java?rev=358954&r1=358953&r2=358954&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 Sat Dec 24 14:09:13 2005
@@ -553,14 +553,12 @@
* arg7: close method
*/
-
- acb.pushThisAsActivation(mb);
mb.push(resultSetNumber);
mb.push(costEstimate.rowCount());
mb.push(costEstimate.getEstimatedCost());
closeMethodArgument(acb, mb);
- mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getUnionResultSet", ClassName.NoPutResultSet, 7);
+ mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getUnionResultSet", ClassName.NoPutResultSet, 6);
}
String getOperatorName()
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=358954&r1=358953&r2=358954&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 Sat Dec 24 14:09:13 2005
@@ -789,18 +789,16 @@
// generate code to evaluate CHECK CONSTRAINTS
generateCheckConstraints( checkConstraints, acb, mb ); // arg 2
- acb.pushThisAsActivation(mb);
-
if(isDependentTable)
{
mb.push(acb.addItem(makeConstantAction()));
mb.push(acb.addItem(makeResultDescription()));
mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getDeleteCascadeUpdateResultSet",
- ClassName.ResultSet, 5);
+ ClassName.ResultSet, 4);
}else
{
mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getUpdateResultSet",
- ClassName.ResultSet, 3);
+ ClassName.ResultSet, 2);
}
}
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java?rev=358954&r1=358953&r2=358954&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/BasicNoPutResultSetImpl.java Sat Dec 24 14:09:13 2005
@@ -132,6 +132,11 @@
this.optimizerEstimatedRowCount = optimizerEstimatedRowCount;
this.optimizerEstimatedCost = optimizerEstimatedCost;
}
+
+ public final Activation getActivation()
+ {
+ return activation;
+ }
// NoPutResultSet interface
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=358954&r1=358953&r2=358954&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 Sat Dec 24 14:09:13 2005
@@ -87,10 +87,10 @@
@exception StandardException thrown on error
*/
public ResultSet getInsertResultSet(NoPutResultSet source,
- GeneratedMethod checkGM,
- Activation activation)
+ GeneratedMethod checkGM)
throws StandardException
{
+ Activation activation = source.getActivation();
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
return new InsertResultSet(source, checkGM, activation );
}
@@ -100,11 +100,11 @@
@exception StandardException thrown on error
*/
public ResultSet getInsertVTIResultSet(NoPutResultSet source,
- NoPutResultSet vtiRS,
- Activation activation)
+ NoPutResultSet vtiRS
+ )
throws StandardException
{
-
+ Activation activation = source.getActivation();
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
return new InsertVTIResultSet(source, vtiRS, activation );
}
@@ -113,10 +113,10 @@
@see ResultSetFactory#getDeleteVTIResultSet
@exception StandardException thrown on error
*/
- public ResultSet getDeleteVTIResultSet(NoPutResultSet source,
- Activation activation)
+ public ResultSet getDeleteVTIResultSet(NoPutResultSet source)
throws StandardException
{
+ Activation activation = source.getActivation();
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
return new DeleteVTIResultSet(source, activation);
}
@@ -125,10 +125,10 @@
@see ResultSetFactory#getDeleteResultSet
@exception StandardException thrown on error
*/
- public ResultSet getDeleteResultSet(NoPutResultSet source,
- Activation activation)
+ public ResultSet getDeleteResultSet(NoPutResultSet source)
throws StandardException
{
+ Activation activation = source.getActivation();
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
return new DeleteResultSet(source, activation );
}
@@ -139,13 +139,12 @@
@exception StandardException thrown on error
*/
public ResultSet getDeleteCascadeResultSet(NoPutResultSet source,
- Activation activation,
int constantActionItem,
ResultSet[] dependentResultSets,
String resultSetId)
throws StandardException
{
-
+ Activation activation = source.getActivation();
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
return new DeleteCascadeResultSet(source, activation,
constantActionItem,
@@ -160,10 +159,10 @@
@exception StandardException thrown on error
*/
public ResultSet getUpdateResultSet(NoPutResultSet source,
- GeneratedMethod checkGM,
- Activation activation)
+ GeneratedMethod checkGM)
throws StandardException
{
+ Activation activation = source.getActivation();
//The stress test failed with null pointer exception in here once and then
//it didn't happen again. It can be a jit problem because after this null
//pointer exception, the cleanup code in UpdateResultSet got a null
@@ -199,15 +198,11 @@
*/
public ResultSet getDeleteCascadeUpdateResultSet(NoPutResultSet source,
GeneratedMethod checkGM,
- Activation activation,
int constantActionItem,
int rsdItem)
throws StandardException
{
- if (SanityManager.DEBUG)
- {
- SanityManager.ASSERT(getAuthorizer(activation) != null, "Authorizer is null");
- }
+ Activation activation = source.getActivation();
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
return new UpdateResultSet(source, checkGM, activation,
constantActionItem, rsdItem);
@@ -231,7 +226,7 @@
@exception StandardException thrown on error
*/
public NoPutResultSet getProjectRestrictResultSet(NoPutResultSet source,
- Activation activation, GeneratedMethod restriction,
+ GeneratedMethod restriction,
GeneratedMethod projection, int resultSetNumber,
GeneratedMethod constantRestriction,
int mapRefItem,
@@ -242,7 +237,7 @@
GeneratedMethod closeCleanup)
throws StandardException
{
- return new ProjectRestrictResultSet(source, activation,
+ return new ProjectRestrictResultSet(source, source.getActivation(),
restriction, projection, resultSetNumber,
constantRestriction, mapRefItem,
reuseResult,
@@ -420,14 +415,14 @@
@exception StandardException thrown on error
*/
public NoPutResultSet getAnyResultSet(NoPutResultSet source,
- Activation activation, GeneratedMethod emptyRowFun, int resultSetNumber,
+ GeneratedMethod emptyRowFun, int resultSetNumber,
int subqueryNumber, int pointOfAttachment,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost)
throws StandardException
{
return new AnyResultSet(source,
- activation, emptyRowFun, resultSetNumber,
+ source.getActivation(), emptyRowFun, resultSetNumber,
subqueryNumber, pointOfAttachment,
optimizerEstimatedRowCount,
optimizerEstimatedCost);
@@ -438,7 +433,7 @@
@exception StandardException thrown on error
*/
public NoPutResultSet getOnceResultSet(NoPutResultSet source,
- Activation activation, GeneratedMethod emptyRowFun,
+ GeneratedMethod emptyRowFun,
int cardinalityCheck, int resultSetNumber,
int subqueryNumber, int pointOfAttachment,
double optimizerEstimatedRowCount,
@@ -446,7 +441,7 @@
throws StandardException
{
return new OnceResultSet(source,
- activation, emptyRowFun,
+ source.getActivation(), emptyRowFun,
cardinalityCheck, resultSetNumber,
subqueryNumber, pointOfAttachment,
optimizerEstimatedRowCount,
@@ -935,13 +930,13 @@
@exception StandardException thrown on error
*/
public NoPutResultSet getMaterializedResultSet(NoPutResultSet source,
- Activation activation, int resultSetNumber,
+ int resultSetNumber,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost,
GeneratedMethod closeCleanup)
throws StandardException
{
- return new MaterializedResultSet(source, activation,
+ return new MaterializedResultSet(source, source.getActivation(),
resultSetNumber,
optimizerEstimatedRowCount,
optimizerEstimatedCost,
@@ -985,7 +980,7 @@
@exception StandardException thrown on error
*/
public NoPutResultSet getNormalizeResultSet(NoPutResultSet source,
- Activation activation, int resultSetNumber,
+ int resultSetNumber,
int erdNumber,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost,
@@ -993,7 +988,7 @@
GeneratedMethod closeCleanup)
throws StandardException
{
- return new NormalizeResultSet(source, activation,
+ return new NormalizeResultSet(source, source.getActivation(),
resultSetNumber, erdNumber,
optimizerEstimatedRowCount,
optimizerEstimatedCost, forUpdate,
@@ -1038,7 +1033,6 @@
*/
public NoPutResultSet getUnionResultSet(NoPutResultSet leftResultSet,
NoPutResultSet rightResultSet,
- Activation activation,
int resultSetNumber,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost,
@@ -1046,7 +1040,7 @@
throws StandardException
{
return new UnionResultSet(leftResultSet, rightResultSet,
- activation,
+ leftResultSet.getActivation(),
resultSetNumber,
optimizerEstimatedRowCount,
optimizerEstimatedCost,
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java?rev=358954&r1=358953&r2=358954&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/NoRowsResultSetImpl.java Sat Dec 24 14:09:13 2005
@@ -146,6 +146,11 @@
{
return (ResultDescription)null;
}
+
+ public final Activation getActivation()
+ {
+ return activation;
+ }
/**
* Returns the row at the absolute position from the query,
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java?rev=358954&r1=358953&r2=358954&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java Sat Dec 24 14:09:13 2005
@@ -36,6 +36,7 @@
import org.apache.derby.iapi.sql.execute.ExecutionFactory;
import org.apache.derby.iapi.sql.execute.TargetResultSet;
+import org.apache.derby.iapi.sql.Activation;
import org.apache.derby.iapi.sql.ResultDescription;
import org.apache.derby.iapi.sql.ResultSet;
import org.apache.derby.iapi.sql.Row;
@@ -1143,6 +1144,12 @@
return clo;
}
public java.sql.SQLWarning getWarnings() {
+ return null;
+ }
+
+ public Activation getActivation() {
+ if (SanityManager.DEBUG)
+ SanityManager.THROWASSERT("getActivation() called for " + getClass());
return null;
}
}