db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r598739 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/
Date Tue, 27 Nov 2007 19:21:40 GMT
Author: djd
Date: Tue Nov 27 11:21:38 2007
New Revision: 598739

URL: http://svn.apache.org/viewvc?rev=598739&view=rev
Log:
DERBY-3049 (partial) More cleanup related to removing the confusing (language) ResultSet.getResultDescription()
method.

Modified:
    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/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/GenericTriggerExecutor.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/IndexChanger.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/RowTriggerExecutor.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/StatementTriggerExecutor.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerInfo.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/DeleteCascadeResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteCascadeResultSet.java?rev=598739&r1=598738&r2=598739&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
Tue Nov 27 11:21:38 2007
@@ -53,7 +53,7 @@
  * it should be done based on whether the resultset has dependent resultsets or not.
  *
  */
-public class DeleteCascadeResultSet extends DeleteResultSet
+class DeleteCascadeResultSet extends DeleteResultSet
 {
 
 
@@ -71,7 +71,7 @@
      * class interface
 	 * @exception StandardException		Thrown on error
      */
-    public DeleteCascadeResultSet
+    DeleteCascadeResultSet
 	(
 		NoPutResultSet		source,
 		Activation			activation,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java?rev=598739&r1=598738&r2=598739&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 Nov 27 11:21:38 2007
@@ -306,18 +306,13 @@
 			if(cascadeDelete)
 			{
 				rowHolder = new TemporaryRowHolderImpl(activation, properties, 
-						(resultDescription != null) ?
-							resultDescription.truncateColumns(rlColumnNumber) :
-							null, false);
+						 false);
 
 
 			}else
 			{
 
-				rowHolder = new TemporaryRowHolderImpl(activation, properties, 
-						(resultDescription != null) ?
-							resultDescription.truncateColumns(rlColumnNumber) :
-							null);
+				rowHolder = new TemporaryRowHolderImpl(activation, properties);
 
 			}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteVTIResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DeleteVTIResultSet.java?rev=598739&r1=598738&r2=598739&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 Nov 27 11:21:38 2007
@@ -102,8 +102,7 @@
 			activation.clearIndexScanInfo();
             if( null == rowHolder)
                 rowHolder =
-                    new TemporaryRowHolderImpl(activation, new Properties(),
-                                               (ResultDescription) null);
+                    new TemporaryRowHolderImpl(activation, new Properties());
 		}
 
         try

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java?rev=598739&r1=598738&r2=598739&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java
Tue Nov 27 11:21:38 2007
@@ -38,17 +38,13 @@
  * a trigger.  It is subclassed by row and statement
  * executors.
  */
-public abstract class GenericTriggerExecutor
+abstract class GenericTriggerExecutor
 {
-	protected InternalTriggerExecutionContext	tec;
-	protected TriggerDescriptor					triggerd;
-	protected Activation						activation;
-	protected LanguageConnectionContext			lcc;
-
-	private	boolean			whenClauseRetrieved;
-	private	boolean			actionRetrieved;
-	private SPSDescriptor	whenClause; 
-	private SPSDescriptor	action;
+	final InternalTriggerExecutionContext	tec;
+	final TriggerDescriptor					triggerd;
+	final Activation						activation;
+	final LanguageConnectionContext			lcc;
+
 
 	private ExecPreparedStatement	ps;
 	private Activation 				spsActivation;
@@ -94,22 +90,12 @@
 
 	protected SPSDescriptor getWhenClause() throws StandardException
 	{
-		if (!whenClauseRetrieved)
-		{
-			whenClauseRetrieved = true;
-			whenClause = triggerd.getWhenClauseSPS();
-		}
-		return whenClause;
+		return triggerd.getWhenClauseSPS();
 	}
 
 	protected SPSDescriptor getAction() throws StandardException
 	{
-		if (!actionRetrieved)
-		{
-			actionRetrieved = true;
-			action = triggerd.getActionSPS(lcc);
-		}
-		return action;
+		return triggerd.getActionSPS(lcc);
 	}
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/IndexChanger.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/IndexChanger.java?rev=598739&r1=598738&r2=598739&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/IndexChanger.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/IndexChanger.java Tue
Nov 27 11:21:38 2007
@@ -408,8 +408,7 @@
 			** row holder (the description is needed when the row
 			** holder is going to be handed to users for triggers).
 			*/
-			rowHolder = new TemporaryRowHolderImpl(activation, properties,
-												   (ResultDescription) null);
+			rowHolder = new TemporaryRowHolderImpl(activation, properties);
 		}
 
 		/*

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=598739&r1=598738&r2=598739&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 Nov 27 11:21:38 2007
@@ -953,8 +953,7 @@
 			/*
 			** If deferred we save a copy of the entire row.
 			*/
-			rowHolder = new TemporaryRowHolderImpl(activation, properties,
-												   resultDescription);
+			rowHolder = new TemporaryRowHolderImpl(activation, properties);
 			rowChanger.setRowHolder(rowHolder);
 		}
 
@@ -976,7 +975,7 @@
 
 			rd = lcc.getLanguageFactory().getResultDescription(resultDescription,columnIndexes);
 			autoGeneratedKeysRowsHolder =
-				new TemporaryRowHolderImpl(activation, properties, rd);
+				new TemporaryRowHolderImpl(activation, properties);
 		}
 
 
@@ -1263,8 +1262,7 @@
 		if (hasBeforeRowTrigger && rowHolder != null)
 		{
 			rowHolder =
-				new TemporaryRowHolderImpl(activation, properties,
-										   resultDescription);
+				new TemporaryRowHolderImpl(activation, properties);
 		}
 
 		// Add any new properties or change the values of any existing properties

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertVTIResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertVTIResultSet.java?rev=598739&r1=598738&r2=598739&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 Nov 27 11:21:38 2007
@@ -136,8 +136,7 @@
 			** If deferred we save a copy of the entire row.
 			*/
 			rowHolder =
-				new TemporaryRowHolderImpl(activation, properties,
-										   resultDescription);
+				new TemporaryRowHolderImpl(activation, properties);
 		}
 
 		while ( row != null )

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowTriggerExecutor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowTriggerExecutor.java?rev=598739&r1=598738&r2=598739&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowTriggerExecutor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/RowTriggerExecutor.java
Tue Nov 27 11:21:38 2007
@@ -33,7 +33,7 @@
  * a row trigger.  It is instantiated at execution time.
  * There is one per row trigger.
  */
-public class RowTriggerExecutor extends GenericTriggerExecutor
+class RowTriggerExecutor extends GenericTriggerExecutor
 {
 	/**
 	 * Constructor

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/StatementTriggerExecutor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/StatementTriggerExecutor.java?rev=598739&r1=598738&r2=598739&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/StatementTriggerExecutor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/StatementTriggerExecutor.java
Tue Nov 27 11:21:38 2007
@@ -33,7 +33,7 @@
  * a statement trigger.  It is instantiated at execution
  * time.  There is one per statement trigger.
  */
-public class StatementTriggerExecutor extends GenericTriggerExecutor
+class StatementTriggerExecutor extends GenericTriggerExecutor
 {
 	/**
 	 * Constructor

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderImpl.java?rev=598739&r1=598738&r2=598739&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderImpl.java
Tue Nov 27 11:21:38 2007
@@ -72,7 +72,7 @@
 	private ConglomerateController	cc;
 	private Properties				properties;
 	private ScanController			scan;
-	private	ResultDescription		resultDescription;
+
 	/** Activation object with local state information. */
 	Activation						activation;
 
@@ -103,17 +103,14 @@
 	 * @param activation the activation
 	 * @param properties the properties of the original table.  Used
 	 *		to help the store use optimal page size, etc.
-	 * @param resultDescription the result description.  Relevant for the getResultDescription
-	 * 		call on the result set returned by getResultSet.  May be null
 	 */
-	public TemporaryRowHolderImpl
+	TemporaryRowHolderImpl
 	(
 		Activation				activation, 
-		Properties 				properties, 
-		ResultDescription		resultDescription
+		Properties 				properties
 	) 
 	{
-		this(activation, properties, resultDescription,
+		this(activation, properties,
 			 DEFAULT_OVERFLOWTHRESHOLD, false, false);
 	}
 	
@@ -124,19 +121,16 @@
 	 * @param activation the activation
 	 * @param properties the properties of the original table.  Used
 	 *		to help the store use optimal page size, etc.
-	 * @param resultDescription the result description.  Relevant for the getResultDescription
-	 * 		call on the result set returned by getResultSet.  May be null
 	 * @param isUniqueStream - true , if it has to be temporary row holder unique stream
 	 */
-	public TemporaryRowHolderImpl
+	TemporaryRowHolderImpl
 	(
 		Activation				activation, 
 		Properties 				properties, 
-		ResultDescription		resultDescription,
 		boolean                 isUniqueStream
 	) 
 	{
-		this(activation, properties, resultDescription, 1, isUniqueStream,
+		this(activation, properties, 1, isUniqueStream,
 			 false);
 	}
 
@@ -147,17 +141,14 @@
 	 * @param activation the activation
 	 * @param properties the properties of the original table.  Used
 	 *		to help the store use optimal page size, etc.
-	 * @param resultDescription the result description.  Relevant for the getResultDescription
-	 * 		call on the result set returned by getResultSet.  May be null
 	 * @param overflowToConglomThreshold on an attempt to insert
 	 * 		this number of rows, the rows will be put
  	 *		into a temporary conglomerate.
 	 */
-	public TemporaryRowHolderImpl
+	TemporaryRowHolderImpl
 	(
 		Activation			 	activation, 
 		Properties				properties,
-		ResultDescription		resultDescription,
 		int 					overflowToConglomThreshold,
 		boolean                 isUniqueStream,
 		boolean					isVirtualMemHeap
@@ -176,7 +167,6 @@
 
 		this.activation = activation;
 		this.properties = properties;
-		this.resultDescription = resultDescription;
 		this.isUniqueStream = isUniqueStream;
 		this.isVirtualMemHeap = isVirtualMemHeap;
 		rowArray = new ExecRow[overflowToConglomThreshold];
@@ -479,12 +469,12 @@
 		if(isUniqueStream)
 		{
 			return new TemporaryRowHolderResultSet(tc, rowArray,
-												   resultDescription, isVirtualMemHeap,
+												   isVirtualMemHeap,
 												   true, positionIndexConglomId, this);
 		}
 		else
 		{
-			return new TemporaryRowHolderResultSet(tc, rowArray, resultDescription, isVirtualMemHeap,
this);
+			return new TemporaryRowHolderResultSet(tc, rowArray, isVirtualMemHeap, this);
 
 		}
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java?rev=598739&r1=598738&r2=598739&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
Tue Nov 27 11:21:38 2007
@@ -57,7 +57,6 @@
 	private boolean 				isOpen;
 	private boolean 				finished;
 	private ExecRow					currentRow;
-	private ResultDescription		resultDescription;
 	private boolean                 isAppendable = false;
 	private long                    positionIndexConglomId;
 	private boolean 				isVirtualMemHeap;
@@ -73,19 +72,17 @@
 	 *
 	 * @param tc the xact controller
 	 * @param rowArray the row array
-	 * @param resultDescription value returned by getResultDescription()
 	 */
-	public TemporaryRowHolderResultSet
+	TemporaryRowHolderResultSet
 	(
 		TransactionController		tc,
 		ExecRow[]					rowArray,
-		ResultDescription			resultDescription,
 		boolean						isVirtualMemHeap,
 		TemporaryRowHolderImpl		holder
    	)
 	{
 
-		this(tc, rowArray, resultDescription, isVirtualMemHeap, false, 0, holder);
+		this(tc, rowArray, isVirtualMemHeap, false, 0, holder);
 
 
 	}
@@ -95,16 +92,14 @@
 	 *
 	 * @param tc the xact controller
 	 * @param rowArray the row array
-	 * @param resultDescription value returned by getResultDescription()
 	 * @param isAppendable true,if we can insert rows after this result is created
 	 * @param positionIndexConglomId conglomId of the index which has order rows
 	 *                               are inserted and their row location 
 	 */
-	public TemporaryRowHolderResultSet
+	TemporaryRowHolderResultSet
 	(
 		TransactionController		tc,
 		ExecRow[]					rowArray,
-		ResultDescription			resultDescription,
 		boolean						isVirtualMemHeap,
 		boolean                     isAppendable,
 		long                        positionIndexConglomId,
@@ -113,7 +108,6 @@
 	{
 		this.tc = tc;
 		this.rowArray = rowArray;
-		this.resultDescription = resultDescription;
 		this.numRowsOut = 0;
 		isOpen = false;
 		finished = false;
@@ -178,15 +172,14 @@
 	 *
 	 * @exception StandardException on error
 	 */
-	public static TemporaryRowHolderResultSet getNewRSOnCurrentRow
+	static TemporaryRowHolderResultSet getNewRSOnCurrentRow
 	(
 		Activation				activation,
 		CursorResultSet 		rs
 	) throws StandardException
 	{
 		TemporaryRowHolderImpl singleRow =
-			new TemporaryRowHolderImpl(activation, null,
-									   rs.getResultDescription());
+			new TemporaryRowHolderImpl(activation, null);
 		singleRow.insert(rs.getCurrentRow());
 		return (TemporaryRowHolderResultSet) singleRow.getResultSet();
 	}
@@ -605,7 +598,7 @@
 	 */
 	public ResultDescription	getResultDescription()
 	{
-		return resultDescription;
+		return null;
 	}
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerInfo.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerInfo.java?rev=598739&r1=598738&r2=598739&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerInfo.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TriggerInfo.java Tue
Nov 27 11:21:38 2007
@@ -129,21 +129,6 @@
 		}
 	}
 
-	/*
-	 * private constructor for TriggerInfo
-	 */
-	private TriggerInfo
-	(
-		TriggerDescriptor[]		triggers,
-		int[]					changedColsIds,
-		String[]				changedColsNames
-	) 
-	{
-		this.columnIds = changedColsIds;
-		this.columnNames = changedColsNames;
-		this.triggerArray = triggers;
-	}
-
 	/**
 	 * Do we have a trigger or triggers that meet
 	 * the criteria

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=598739&r1=598738&r2=598739&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 Nov 27 11:21:38 2007
@@ -390,12 +390,10 @@
 			rowChanger.getHeapConglomerateController().getInternalTablePropertySet(properties);
 			if(beforeUpdateCopyRequired){
 				deletedRowHolder =
-					new TemporaryRowHolderImpl(activation, properties,
-											   triggerResultDescription);
+					new TemporaryRowHolderImpl(activation, properties);
 			}
 			insertedRowHolder =
-				new TemporaryRowHolderImpl(activation, properties,
-										   triggerResultDescription);
+				new TemporaryRowHolderImpl(activation, properties);
 
 			rowChanger.setRowHolder(insertedRowHolder);
 		}
@@ -742,7 +740,7 @@
 						// in-memory heap grows), hopefully we never spill temp table to disk.
 
 						tableScan.futureForUpdateRows = new TemporaryRowHolderImpl
-							(activation, null, null, 100, false, true);
+							(activation, null, 100, false, true);
 					}
 
 					rlRow.setColumn(1, rowLoc);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateVTIResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/UpdateVTIResultSet.java?rev=598739&r1=598738&r2=598739&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 Nov 27 11:21:38 2007
@@ -98,8 +98,7 @@
 			** If deferred we save a copy of the entire row.
 			*/
 			rowHolder =
-				new TemporaryRowHolderImpl(activation, properties,
-										   resultDescription);
+				new TemporaryRowHolderImpl(activation, properties);
 		}
 
         try



Mime
View raw message