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 2006/01/10 15:43:54 UTC
svn commit: r367619 -
/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/
Author: djd
Date: Tue Jan 10 06:41:25 2006
New Revision: 367619
URL: http://svn.apache.org/viewcvs?rev=367619&view=rev
Log:
DERBY-467 Make some public & protected classes and members in the org.apache.derby.impl.sql.execute package
have more secure protection by making them private or package protected.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLVTIResultSet.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteVTIResultSet.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertVTIResultSet.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/RowChangerImpl.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowResultSet.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateVTIResultSet.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLVTIResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLVTIResultSet.java?rev=367619&r1=367618&r2=367619&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLVTIResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLVTIResultSet.java Tue Jan 10 06:41:25 2006
@@ -45,17 +45,14 @@
// passed in at construction time
- protected NoPutResultSet sourceResultSet;
- public NoPutResultSet savedSource;
- public UpdatableVTIConstantAction constants;
- public TransactionController tc;
- public LanguageConnectionContext lcc;
+ NoPutResultSet sourceResultSet;
+ NoPutResultSet savedSource;
+ UpdatableVTIConstantAction constants;
+ TransactionController tc;
- public ResultDescription resultDescription;
+ ResultDescription resultDescription;
private int numOpens;
- protected boolean firstExecute;
-
- public ExecRow row;
+ boolean firstExecute;
/**
* Returns the description of the inserted rows.
@@ -70,7 +67,7 @@
*
* @exception StandardException Thrown on error
*/
- public DMLVTIResultSet(NoPutResultSet source,
+ DMLVTIResultSet(NoPutResultSet source,
Activation activation)
throws StandardException
{
@@ -78,7 +75,6 @@
sourceResultSet = source;
constants = (UpdatableVTIConstantAction) constantAction;
- lcc = activation.getLanguageConnectionContext();
tc = activation.getTransactionController();
resultDescription = sourceResultSet.getResultDescription();
@@ -104,9 +100,7 @@
}
openCore();
-
- row = null;
-
+
/* Cache query plan text for source, before it gets blown away */
if (lcc.getRunTimeStatisticsMode())
{
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java?rev=367619&r1=367618&r2=367619&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java Tue Jan 10 06:41:25 2006
@@ -61,12 +61,12 @@
*
* @exception StandardException on error
*/
- protected DMLWriteResultSet(Activation activation)
+ DMLWriteResultSet(Activation activation)
throws StandardException
{
this(activation, activation.getConstantAction());
}
- protected DMLWriteResultSet(Activation activation, ConstantAction constantAction)
+ DMLWriteResultSet(Activation activation, ConstantAction constantAction)
throws StandardException
{
super(activation);
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java?rev=367619&r1=367618&r2=367619&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java Tue Jan 10 06:41:25 2006
@@ -61,19 +61,18 @@
* and triggers to be executed based on the c's and t's
* compiled into the insert plan.
*/
-public class DeleteResultSet extends DMLWriteResultSet
+class DeleteResultSet extends DMLWriteResultSet
{
- public TransactionController tc;
- public DeleteConstantAction constants;
+ private TransactionController tc;
+ DeleteConstantAction constants;
protected ResultDescription resultDescription;
protected NoPutResultSet source;
- public NoPutResultSet savedSource;
+ NoPutResultSet savedSource;
int numIndexes;
protected RowChanger rc;
- public ExecRow row;
+ private ExecRow row;
protected ConglomerateController deferredBaseCC;
- public LanguageConnectionContext lcc;
protected TemporaryRowHolderImpl rowHolder;
@@ -109,7 +108,7 @@
* class interface
*
*/
- public DeleteResultSet
+ DeleteResultSet
(
NoPutResultSet source,
Activation activation
@@ -127,7 +126,7 @@
*
* @exception StandardException Thrown on error
*/
- protected DeleteResultSet
+ DeleteResultSet
(
NoPutResultSet source,
ConstantAction passedInConstantAction,
@@ -138,7 +137,6 @@
super(activation, passedInConstantAction);
this.source = source;
- lcc = activation.getLanguageConnectionContext();
tc = activation.getTransactionController();
constants = (DeleteConstantAction) constantAction;
fkInfoArray = constants.getFKInfo( lcc.getExecutionContext() );
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteVTIResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteVTIResultSet.java?rev=367619&r1=367618&r2=367619&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteVTIResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteVTIResultSet.java Tue Jan 10 06:41:25 2006
@@ -41,7 +41,7 @@
* and triggers to be executed based on the c's and t's
* compiled into the insert plan.
*/
-public class DeleteVTIResultSet extends DMLVTIResultSet
+class DeleteVTIResultSet extends DMLVTIResultSet
{
private java.sql.ResultSet rs;
@@ -76,7 +76,7 @@
{
lcc.getStatementContext().setTopResultSet(this, subqueryTrackingArray);
- row = getNextRowCore(sourceResultSet);
+ ExecRow row = getNextRowCore(sourceResultSet);
if (row != null)
{
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java?rev=367619&r1=367618&r2=367619&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java Tue Jan 10 06:41:25 2006
@@ -105,7 +105,7 @@
* and triggers to be executed based on the c's and t's
* compiled into the insert plan.
*/
-public class InsertResultSet extends DMLWriteResultSet implements TargetResultSet
+class InsertResultSet extends DMLWriteResultSet implements TargetResultSet
{
// RESOLVE. Embarassingly large public state. If we could move the Replication
// code into the same package, then these variables could be protected.
@@ -113,27 +113,25 @@
// passed in at construction time
private NoPutResultSet sourceResultSet;
- public NoPutResultSet savedSource;
- public InsertConstantAction constants;
+ NoPutResultSet savedSource;
+ InsertConstantAction constants;
private GeneratedMethod checkGM;
private long heapConglom;
//following is for jdbc3.0 feature auto generated keys resultset
- public ResultSet autoGeneratedKeysResultSet;
+ private ResultSet autoGeneratedKeysResultSet;
private TemporaryRowHolderImpl autoGeneratedKeysRowsHolder;
// divined at run time
- public ResultDescription resultDescription;
+ private ResultDescription resultDescription;
private RowChanger rowChanger;
- public TransactionController tc;
- public ExecRow row;
-
- public LanguageConnectionContext lcc;
+ private TransactionController tc;
+ private ExecRow row;
- public boolean userSpecifiedBulkInsert;
- public boolean bulkInsertPerformed;
+ boolean userSpecifiedBulkInsert;
+ boolean bulkInsertPerformed;
// bulkInsert
protected boolean bulkInsert;
@@ -338,7 +336,7 @@
*
* @exception StandardException Thrown on error
*/
- public InsertResultSet(NoPutResultSet source,
+ InsertResultSet(NoPutResultSet source,
GeneratedMethod checkGM,
Activation activation)
throws StandardException
@@ -349,7 +347,6 @@
this.checkGM = checkGM;
heapConglom = constants.conglomId;
- lcc = activation.getLanguageConnectionContext();
tc = activation.getTransactionController();
fkInfoArray = constants.getFKInfo( lcc.getExecutionContext() );
triggerInfo = constants.getTriggerInfo(lcc.getExecutionContext());
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertVTIResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertVTIResultSet.java?rev=367619&r1=367618&r2=367619&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertVTIResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertVTIResultSet.java Tue Jan 10 06:41:25 2006
@@ -48,7 +48,7 @@
* and triggers to be executed based on the c's and t's
* compiled into the insert plan.
*/
-public class InsertVTIResultSet extends DMLVTIResultSet
+class InsertVTIResultSet extends DMLVTIResultSet
{
private PreparedStatement ps;
@@ -95,7 +95,7 @@
}
}
- row = getNextRowCore(sourceResultSet);
+ ExecRow row = getNextRowCore(sourceResultSet);
try
{
@@ -105,14 +105,7 @@
{
throw StandardException.unexpectedUserException(t);
}
- normalInsertCore(lcc, firstExecute);
- } // end of openCore
-
- // Do the work for a "normal" insert
- private void normalInsertCore(LanguageConnectionContext lcc, boolean firstExecute)
- throws StandardException
- {
/* Get or re-use the row changer.
* NOTE: We need to set ourself as the top result set
* if this is not the 1st execution. (Done in constructor
@@ -157,7 +150,7 @@
}
else
{
- insertIntoVTI(rs);
+ insertIntoVTI(rs, row);
}
rowCount++;
@@ -182,13 +175,10 @@
CursorResultSet tempRS = rowHolder.getResultSet();
try
{
- ExecRow deferredRowBuffer = null;
-
tempRS.open();
- while ((deferredRowBuffer = tempRS.getNextRow()) != null)
+ while ((row = tempRS.getNextRow()) != null)
{
- row = deferredRowBuffer;
- insertIntoVTI(rs);
+ insertIntoVTI(rs, row);
}
} finally
{
@@ -204,7 +194,7 @@
}
} // end of normalInsertCore
- private void insertIntoVTI(ResultSet target)
+ private void insertIntoVTI(ResultSet target, ExecRow row)
throws StandardException
{
try
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=367619&r1=367618&r2=367619&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 Tue Jan 10 06:41:25 2006
@@ -79,10 +79,9 @@
*/
abstract class NoRowsResultSetImpl implements ResultSet
{
- protected final Activation activation;
- private boolean isTopResultSet = true;
+ final Activation activation;
private boolean dumpedStats;
- protected NoPutResultSet[] subqueryTrackingArray;
+ NoPutResultSet[] subqueryTrackingArray;
private final boolean statisticsTimingOn;
private boolean isClosed;
@@ -93,7 +92,7 @@
protected int sourceDepth;
/* Run time statistics variables */
- protected final LanguageConnectionContext lcc;
+ final LanguageConnectionContext lcc;
protected long beginTime;
protected long endTime;
protected long beginExecutionTime;
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowChangerImpl.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowChangerImpl.java?rev=367619&r1=367618&r2=367619&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowChangerImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowChangerImpl.java Tue Jan 10 06:41:25 2006
@@ -51,7 +51,7 @@
/**
Perform row at a time DML operations of tables and maintain indexes.
*/
-public class RowChangerImpl implements RowChanger
+class RowChangerImpl implements RowChanger
{
boolean isOpen = false;
@@ -69,7 +69,7 @@
TransactionController tc;
FormatableBitSet changedColumnBitSet;
FormatableBitSet baseRowReadList;
- protected int[] baseRowReadMap; //index=heap column, value=input row column.
+ private int[] baseRowReadMap; //index=heap column, value=input row column.
int[] changedColumnIds;
TemporaryRowHolderImpl rowHolder;
@@ -78,9 +78,9 @@
//
//Stuff filled in by open
- protected ConglomerateController baseCC = null;
- protected RowLocation baseRowLocation = null;
- IndexSetChanger isc;
+ private ConglomerateController baseCC;
+ private RowLocation baseRowLocation;
+ private IndexSetChanger isc;
// a row array with all non-updated columns compacted out
private DataValueDescriptor[] sparseRowArray;
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowResultSet.java?rev=367619&r1=367618&r2=367619&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowResultSet.java Tue Jan 10 06:41:25 2006
@@ -51,7 +51,7 @@
*
* @author ames
*/
-public class RowResultSet extends NoPutResultSetImpl
+class RowResultSet extends NoPutResultSetImpl
implements CursorResultSet {
/* Run time statistics variables */
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java?rev=367619&r1=367618&r2=367619&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java Tue Jan 10 06:41:25 2006
@@ -68,17 +68,17 @@
*
* @author ames
*/
-public class UpdateResultSet extends DMLWriteResultSet
+class UpdateResultSet extends DMLWriteResultSet
{
- public TransactionController tc;
- public ExecRow newBaseRow;
- public ExecRow row;
- public ExecRow deferredSparseRow;
- public UpdateConstantAction constants;
+ private TransactionController tc;
+ private ExecRow newBaseRow;
+ private ExecRow row;
+ private ExecRow deferredSparseRow;
+ UpdateConstantAction constants;
private ResultDescription resultDescription;
private NoPutResultSet source;
- public NoPutResultSet savedSource;
+ NoPutResultSet savedSource;
private RowChanger rowChanger;
protected ConglomerateController deferredBaseCC;
@@ -87,7 +87,6 @@
protected boolean[] deferredUniqueCreated;
protected ConglomerateController deferredUniqueCC[];
protected ScanController[] deferredUniqueScans;
- public LanguageConnectionContext lcc;
private TemporaryRowHolderImpl deletedRowHolder;
private TemporaryRowHolderImpl insertedRowHolder;
@@ -133,7 +132,7 @@
* @param compiledConstants constantAction for the update
* @exception StandardException thrown on error
*/
- public UpdateResultSet(NoPutResultSet source,
+ UpdateResultSet(NoPutResultSet source,
GeneratedMethod checkGM,
Activation activation)
throws StandardException
@@ -153,7 +152,7 @@
* @param rsdItem id of the Result Description saved object
* @exception StandardException thrown on error
*/
- public UpdateResultSet(NoPutResultSet source,
+ UpdateResultSet(NoPutResultSet source,
GeneratedMethod checkGM,
Activation activation,
int constantActionItem,
@@ -179,7 +178,7 @@
* @param compiledConstants constantAction for the update
* @exception StandardException thrown on error
*/
- public UpdateResultSet(NoPutResultSet source,
+ UpdateResultSet(NoPutResultSet source,
GeneratedMethod checkGM,
Activation activation,
ConstantAction passedInConstantAction,
@@ -187,9 +186,8 @@
throws StandardException
{
super(activation, passedInConstantAction);
- // find the language context.
- lcc = activation.getLanguageConnectionContext();
- // Get the current transaction controller
+
+ // Get the current transaction controller
tc = activation.getTransactionController();
this.source = source;
this.checkGM = checkGM;
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateVTIResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateVTIResultSet.java?rev=367619&r1=367618&r2=367619&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateVTIResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateVTIResultSet.java Tue Jan 10 06:41:25 2006
@@ -44,7 +44,7 @@
* Update the rows from the source into the specified
* base table.
*/
-public class UpdateVTIResultSet extends DMLVTIResultSet
+class UpdateVTIResultSet extends DMLVTIResultSet
{
private java.sql.ResultSet rs;
@@ -71,7 +71,7 @@
boolean firstRow = true;
rs = activation.getTargetVTI();
- row = getNextRowCore(sourceResultSet);
+ ExecRow row = getNextRowCore(sourceResultSet);
if( null != row)
rowLocationColumn = row.nColumns();
@@ -120,7 +120,7 @@
rowHolder.insert(row);
}
else
- updateVTI( rs);
+ updateVTI(rs, row);
rowCount++;
// No need to do a next on a single row source
@@ -152,15 +152,12 @@
CursorResultSet tempRS = rowHolder.getResultSet();
try
{
- ExecRow deferredRowBuffer = null;
-
tempRS.open();
- while ((deferredRowBuffer = tempRS.getNextRow()) != null)
+ while ((row = tempRS.getNextRow()) != null)
{
- row = deferredRowBuffer;
int rowNumber = row.getColumn( rowLocationColumn).getInt();
rs.absolute( rowNumber);
- updateVTI(rs);
+ updateVTI(rs, row);
}
}
catch (Throwable t)
@@ -181,7 +178,7 @@
}
} // end of openCore
- private void updateVTI(ResultSet target)
+ private void updateVTI(ResultSet target, ExecRow row)
throws StandardException
{
int[] changedColumnIds = constants.changedColumnIds;