Author: djd Date: Mon Dec 3 12:42:47 2007 New Revision: 600678 URL: http://svn.apache.org/viewvc?rev=600678&view=rev Log: DERBY-3049 (partial) Cleanup of some unused fields/variables in ResultSet implementations that leads to some ResultDescription related methods being no longer used and hence removed Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/LanguageFactory.java db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultDescription.java db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericLanguageFactory.java db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericResultDescription.java db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteCascadeResultSet.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/TriggerEventActivator.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/WriteCursorConstantAction.java Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/LanguageFactory.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/LanguageFactory.java?rev=600678&r1=600677&r2=600678&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/LanguageFactory.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/LanguageFactory.java Mon Dec 3 12:42:47 2007 @@ -55,22 +55,6 @@ ParameterValueSet newParameterValueSet(ClassInspector ci, int numParms, boolean hasReturnParam); /** - * Get a new result description from the input result - * description. Picks only the columns in the column - * array from the inputResultDescription. - * - * @param inputResultDescription the input rd - * @param theCols non null array of ints - * - * @return ResultDescription the rd - */ - public ResultDescription getResultDescription - ( - ResultDescription inputResultDescription, - int[] theCols - ); - - /** * Get a new result description * * @param cols an array of col descriptors Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultDescription.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultDescription.java?rev=600678&r1=600677&r2=600678&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultDescription.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/ResultDescription.java Mon Dec 3 12:42:47 2007 @@ -66,22 +66,6 @@ * column in the ResultSet. */ ResultColumnDescriptor getColumnDescriptor(int position); - - /** - * Get a new result description that has been truncated - * from input column number. If the input column is - * 5, then columns 5 to getColumnCount() are removed. - * The new ResultDescription points to the same - * ColumnDescriptors (this method performs a shallow - * copy. The saved JDBC ResultSetMetaData will - * not be copied. - * - * @param truncateFrom the starting column to remove, - * 1-based. - * - * @return a new ResultDescription - */ - public ResultDescription truncateColumns(int truncateFrom); /** * Set the JDBC ResultSetMetaData for this ResultDescription. Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java?rev=600678&r1=600677&r2=600678&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDescriptorGenerator.java Mon Dec 3 12:42:47 2007 @@ -21,30 +21,14 @@ package org.apache.derby.iapi.sql.dictionary; -import org.apache.derby.iapi.services.monitor.Monitor; -import org.apache.derby.iapi.error.StandardException; - -import org.apache.derby.iapi.sql.dictionary.*; - -import org.apache.derby.iapi.types.TypeId; -import org.apache.derby.iapi.sql.depend.Dependent; -import org.apache.derby.iapi.sql.depend.Provider; -import org.apache.derby.iapi.reference.SQLState; -import org.apache.derby.iapi.sql.execute.ConstantAction; -import org.apache.derby.iapi.sql.execute.ExecPreparedStatement; -import org.apache.derby.iapi.services.uuid.UUIDFactory; -import org.apache.derby.iapi.services.io.FormatableBitSet; +import java.sql.Timestamp; -import org.apache.derby.catalog.AliasInfo; -import org.apache.derby.catalog.DefaultInfo; -import org.apache.derby.catalog.Dependable; -import org.apache.derby.catalog.DependableFinder; import org.apache.derby.catalog.ReferencedColumns; -import org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl; import org.apache.derby.catalog.UUID; -import org.apache.derby.catalog.Statistics; -import java.sql.Timestamp; -import java.io.InputStream; +import org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl; +import org.apache.derby.iapi.error.StandardException; +import org.apache.derby.iapi.services.io.FormatableBitSet; +import org.apache.derby.iapi.services.uuid.UUIDFactory; /** * This is an implementation of the DataDescriptorGenerator interface @@ -68,6 +52,7 @@ public DataDescriptorGenerator( DataDictionary dataDictionary ) { this.dataDictionary = dataDictionary; + uuidf = dataDictionary.getUUIDFactory(); } /** @@ -413,8 +398,6 @@ */ protected UUIDFactory getUUIDFactory() { - if (uuidf == null) - uuidf = Monitor.getMonitor().getUUIDFactory(); return uuidf; } Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericLanguageFactory.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericLanguageFactory.java?rev=600678&r1=600677&r2=600678&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericLanguageFactory.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericLanguageFactory.java Mon Dec 3 12:42:47 2007 @@ -100,25 +100,6 @@ } /** - * Get a new result description from the input result - * description. Picks only the columns in the column - * array from the inputResultDescription. - * - * @param inputResultDescription the input rd - * @param theCols array of ints, non null - * - * @return ResultDescription the rd - */ - public ResultDescription getResultDescription - ( - ResultDescription inputResultDescription, - int[] theCols - ) - { - return new GenericResultDescription(inputResultDescription, theCols); - } - - /** * Get a new result description * * @param cols an array of col descriptors Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericResultDescription.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericResultDescription.java?rev=600678&r1=600677&r2=600678&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericResultDescription.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/GenericResultDescription.java Mon Dec 3 12:42:47 2007 @@ -79,7 +79,7 @@ * A map which maps a column name to a column number. * Entries only added when accessing columns with the name. */ - private Map columnNameMap; + private transient Map columnNameMap; /** * Niladic constructor for Formatable @@ -101,31 +101,6 @@ this.statementType = statementType; } - /** - * Build a GenericResultDescription - * - * @param rd the result description - * @param theCols the columns to take from the input rd - */ - public GenericResultDescription - ( - ResultDescription rd, - int[] theCols - ) - { - if (SanityManager.DEBUG) - { - SanityManager.ASSERT(theCols != null, "theCols argument to GenericResultDescription is null"); - } - - this.columns = new ResultColumnDescriptor[theCols.length]; - for (int i = 0; i < theCols.length; i++) - { - columns[i] = rd.getColumnDescriptor(theCols[i]); - } - this.statementType = rd.getStatementType(); - } - // // ResultDescription interface // @@ -154,36 +129,6 @@ */ public ResultColumnDescriptor getColumnDescriptor(int position) { return columns[position-1]; - } - - /** - * Get a new result description that has been truncated - * from input column number. If the input column is - * 5, then columns 5 to getColumnCount() are removed. - * The new ResultDescription points to the same - * ColumnDescriptors (this method performs a shallow - * copy. - * - * @param truncateFrom the starting column to remove - * - * @return a new ResultDescription - */ - public ResultDescription truncateColumns(int truncateFrom) - { - if (SanityManager.DEBUG) - { - if (!(truncateFrom > 0 && columns != null)) - { - SanityManager.THROWASSERT("bad truncate value: "+truncateFrom+" is too low"); - } - if (truncateFrom > columns.length) - { - SanityManager.THROWASSERT("bad truncate value: "+truncateFrom+" is too high"); - } - } - ResultColumnDescriptor[] newColumns = new ResultColumnDescriptor[truncateFrom-1]; - System.arraycopy(columns, 0, newColumns, 0, newColumns.length); - return new GenericResultDescription(newColumns, statementType); } Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteCascadeResultSet.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteCascadeResultSet.java?rev=600678&r1=600677&r2=600678&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteCascadeResultSet.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteCascadeResultSet.java Mon Dec 3 12:42:47 2007 @@ -59,9 +59,6 @@ public ResultSet[] dependentResultSets; private int noDependents =0; - private CursorResultSet parentSource; - private FKInfo parentFKInfo; - private long fkIndexConglomNumber; private String resultSetId; private boolean mainNodeForTable = true; private boolean affectedRows = false; @@ -87,13 +84,8 @@ (ConstantAction)activation.getPreparedStatement().getSavedObject(constantActionItem)), activation); - ConstantAction passedInConstantAction; - if(constantActionItem == -1) - passedInConstantAction = activation.getConstantAction(); //root table - else + if(constantActionItem != -1) { - passedInConstantAction = - (ConstantAction) activation.getPreparedStatement().getSavedObject(constantActionItem); resultDescription = constants.resultDescription; } cascadeDelete = true; Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java?rev=600678&r1=600677&r2=600678&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 Mon Dec 3 12:42:47 2007 @@ -960,7 +960,6 @@ int[] columnIndexes = null; if (firstExecute && activation.getAutoGeneratedKeysResultsetMode()) { - ResultDescription rd; Properties properties = new Properties(); columnIndexes = activation.getAutoGeneratedKeysColumnIndexes(); @@ -973,7 +972,6 @@ columnIndexes = generatedColumnPositionsArray(); } - rd = lcc.getLanguageFactory().getResultDescription(resultDescription,columnIndexes); autoGeneratedKeysRowsHolder = new TemporaryRowHolderImpl(activation, properties); } Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerEventActivator.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerEventActivator.java?rev=600678&r1=600677&r2=600678&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerEventActivator.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerEventActivator.java Mon Dec 3 12:42:47 2007 @@ -21,34 +21,26 @@ package org.apache.derby.impl.sql.execute; -import org.apache.derby.iapi.services.sanity.SanityManager; -import org.apache.derby.iapi.error.StandardException; +import java.util.Vector; -import org.apache.derby.iapi.sql.execute.CursorResultSet; -import org.apache.derby.iapi.sql.execute.NoPutResultSet; -import org.apache.derby.iapi.sql.execute.ExecRow; +import org.apache.derby.catalog.UUID; +import org.apache.derby.iapi.error.StandardException; +import org.apache.derby.iapi.jdbc.ConnectionContext; +import org.apache.derby.iapi.services.sanity.SanityManager; +import org.apache.derby.iapi.sql.Activation; import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; import org.apache.derby.iapi.sql.dictionary.TriggerDescriptor; - -import org.apache.derby.iapi.sql.Activation; - +import org.apache.derby.iapi.sql.execute.CursorResultSet; +import org.apache.derby.iapi.sql.execute.NoPutResultSet; import org.apache.derby.iapi.store.access.TransactionController; -import org.apache.derby.impl.sql.execute.AutoincrementCounter; -import org.apache.derby.iapi.reference.SQLState; -import org.apache.derby.iapi.jdbc.ConnectionContext; -import org.apache.derby.catalog.UUID; - -import java.util.Vector; -import java.sql.SQLException; /** * Responsible for firing a trigger or set of triggers * based on an event. */ -public class TriggerEventActivator +class TriggerEventActivator { private LanguageConnectionContext lcc; - private TransactionController tc; private TriggerInfo triggerInfo; private InternalTriggerExecutionContext tec; private GenericTriggerExecutor[][] executors; @@ -72,7 +64,7 @@ * * @exception StandardException on error */ - public TriggerEventActivator + TriggerEventActivator ( LanguageConnectionContext lcc, TransactionController tc, @@ -92,7 +84,6 @@ tableName = triggerInfo.triggerArray[0].getTableDescriptor().getQualifiedName(); this.lcc = lcc; - this.tc = tc; this.activation = activation; this.tableId = tableId; this.dmlType = dmlType; @@ -227,7 +218,7 @@ * * @exception StandardException on error */ - public void notifyEvent + void notifyEvent ( TriggerEvent event, CursorResultSet brs, @@ -290,7 +281,7 @@ * * @exception StandardException on unexpected error */ - public void cleanup() throws StandardException + void cleanup() throws StandardException { if (tec != null) { Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java?rev=600678&r1=600677&r2=600678&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 Mon Dec 3 12:42:47 2007 @@ -34,7 +34,6 @@ 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.conn.LanguageConnectionContext; import org.apache.derby.iapi.sql.execute.ConstantAction; import org.apache.derby.iapi.sql.execute.CursorResultSet; import org.apache.derby.iapi.sql.execute.ExecRow; @@ -93,7 +92,6 @@ private ExecRow deferredTempRow; private ExecRow deferredBaseRow; private ExecRow oldDeletedRow; - private ResultDescription triggerResultDescription; int lockMode; boolean deferred; @@ -379,9 +377,6 @@ { deferredTempRow = RowUtil.getEmptyValueRow(numberOfBaseColumns+1, lcc); oldDeletedRow = RowUtil.getEmptyValueRow(numberOfBaseColumns, lcc); - triggerResultDescription = (resultDescription != null) ? - resultDescription.truncateColumns(numberOfBaseColumns+1) : - null; } Properties properties = new Properties(); Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java?rev=600678&r1=600677&r2=600678&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java Mon Dec 3 12:42:47 2007 @@ -63,12 +63,14 @@ ** ** This class implements Formatable. But it is NOT used ** across either major or minor releases. It is only - ** written persistently in stored prepared statements, - ** not in the replication stage. SO, IT IS OK TO CHANGE - ** ITS read/writeExternal. + ** written persistently in stored prepared statements. + * SO, IT IS OK TO CHANGE ITS read/writeExternal. ** ********************************************************/ + /** + * Heap conglomerate identifier. + */ long conglomId; StaticCompiledOpenConglomInfo heapSCOCI; IndexRowGenerator[] irgs;