db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r598716 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute: DependentResultSet.java HashScanResultSet.java LastIndexKeyResultSet.java ScanResultSet.java TableScanResultSet.java
Date Tue, 27 Nov 2007 17:49:19 GMT
Author: djd
Date: Tue Nov 27 09:49:16 2007
New Revision: 598716

URL: http://svn.apache.org/viewvc?rev=598716&view=rev
Log:
Consolidate the accessedCols field in the super-class ScanResultSet for the scan implementations

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/HashScanResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/LastIndexKeyResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ScanResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TableScanResultSet.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java?rev=598716&r1=598715&r2=598716&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java
Tue Nov 27 09:49:16 2007
@@ -101,7 +101,6 @@
 	public String userSuppliedOptimizerOverrides;
 	public String indexName;
 	protected boolean runTimeStatisticsOn;
-	protected FormatableBitSet accessedCols;
 	public int rowsPerRead;
 	public boolean forUpdate;
 	private boolean sameStartStopPosition;
@@ -154,6 +153,7 @@
 			  //REPEATABLE READ irrespective what the user level isolation
 			  //level is.
 			  TransactionController.ISOLATION_REPEATABLE_READ,
+              colRefItem,
 			  optimizerEstimatedRowCount, optimizerEstimatedCost);
 
 		this.conglomId = conglomId;
@@ -191,15 +191,6 @@
 		this.forUpdate = forUpdate;
 		this.rowsPerRead = rowsPerRead;
 		this.oneRowScan = oneRowScan;
-
-		// retrieve the valid column list from
-		// the saved objects, if it exists
-		this.accessedCols = null;
-		if (colRefItem != -1)
-		{
-			this.accessedCols = (FormatableBitSet)(activation.getPreparedStatement().
-						getSavedObject(colRefItem));
-		}
 		
 		runTimeStatisticsOn = (activation != null &&
 							   activation.getLanguageConnectionContext().getRunTimeStatisticsMode());

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/HashScanResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/HashScanResultSet.java?rev=598716&r1=598715&r2=598716&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/HashScanResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/HashScanResultSet.java
Tue Nov 27 09:49:16 2007
@@ -90,7 +90,6 @@
 	public String indexName;
 	public boolean forUpdate;
 	private boolean runTimeStatisticsOn;
-	private FormatableBitSet accessedCols;
 	public int[] keyColumns;
 	private boolean sameStartStopPosition;
 	private boolean skipNullKeyColumns;
@@ -145,6 +144,7 @@
 				resultSetNumber,
 				resultRowAllocator,
 				lockMode, tableLocked, isolationLevel,
+                colRefItem,
 				optimizerEstimatedRowCount,
 				optimizerEstimatedCost);
         this.scoci = scoci;
@@ -189,15 +189,6 @@
 		for (int index = 0; index < fihArray.length; index++)
 		{
 			keyColumns[index] = fihArray[index].getInt();
-		}
-
-		// retrieve the valid column list from
-		// the saved objects, if it exists
-		this.accessedCols = null;
-		if (colRefItem != -1)
-		{
-			this.accessedCols = (FormatableBitSet)(activation.getPreparedStatement().
-										  getSavedObject(colRefItem));
 		}
 
 		runTimeStatisticsOn = 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/LastIndexKeyResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/LastIndexKeyResultSet.java?rev=598716&r1=598715&r2=598716&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/LastIndexKeyResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/LastIndexKeyResultSet.java
Tue Nov 27 09:49:16 2007
@@ -22,7 +22,6 @@
 package org.apache.derby.impl.sql.execute;
 
 import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.services.io.FormatableBitSet;
 import org.apache.derby.iapi.services.loader.GeneratedMethod;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.sql.Activation;
@@ -52,7 +51,6 @@
 	public String userSuppliedOptimizerOverrides;
 	public String indexName;
 	protected boolean runTimeStatisticsOn;
-	protected FormatableBitSet accessedCols;
 
 	// Run time statistics
 	public String stopPositionString;
@@ -110,6 +108,7 @@
 				resultSetNumber,
 				resultRowAllocator,
 				lockMode, tableLocked, isolationLevel,
+                colRefItem,
 				optimizerEstimatedRowCount,
 				optimizerEstimatedCost);
 
@@ -125,11 +124,6 @@
 		this.tableName = tableName;
 		this.userSuppliedOptimizerOverrides = userSuppliedOptimizerOverrides;
 		this.indexName = indexName;
-		if (colRefItem != -1)
-		{
-			this.accessedCols = (FormatableBitSet)(activation.getPreparedStatement().
-						getSavedObject(colRefItem));
-		}
 
 		runTimeStatisticsOn = getLanguageConnectionContext().getRunTimeStatisticsMode();
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ScanResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ScanResultSet.java?rev=598716&r1=598715&r2=598716&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ScanResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ScanResultSet.java Tue
Nov 27 09:49:16 2007
@@ -20,6 +20,7 @@
 package org.apache.derby.impl.sql.execute;
 
 import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.io.FormatableBitSet;
 import org.apache.derby.iapi.services.loader.GeneratedMethod;
 import org.apache.derby.iapi.sql.Activation;
 import org.apache.derby.iapi.sql.execute.ExecRow;
@@ -50,6 +51,13 @@
 
     /** The candidate row. */
     final ExecRow candidate;
+    
+    /**
+     * If not null indicates the subset of columns that
+     * need to be pulled from the underlying object to be scanned.
+     * Set from the PreparedStatement's saved objects, if it exists.
+     */
+    protected final FormatableBitSet accessedCols;
 
     /**
      * Construct a <code>ScanResultSet</code>.
@@ -66,6 +74,7 @@
     ScanResultSet(Activation activation, int resultSetNumber,
                   GeneratedMethod resultRowAllocator,
                   int lockMode, boolean tableLocked, int isolationLevel,
+                  int colRefItem,
                   double optimizerEstimatedRowCount,
                   double optimizerEstimatedCost) throws StandardException {
         super(activation, resultSetNumber,
@@ -88,6 +97,10 @@
 
         /* Only call row allocators once */
         candidate = (ExecRow) resultRowAllocator.invoke(activation);
+        
+        this.accessedCols = colRefItem != -1 ?
+            (FormatableBitSet)(activation.getPreparedStatement().
+                getSavedObject(colRefItem)) : null;      
     }
 
     /**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TableScanResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TableScanResultSet.java?rev=598716&r1=598715&r2=598716&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TableScanResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/TableScanResultSet.java
Tue Nov 27 09:49:16 2007
@@ -79,7 +79,6 @@
 	public String userSuppliedOptimizerOverrides;
 	public String indexName;
 	protected boolean runTimeStatisticsOn;
-	protected FormatableBitSet accessedCols;
     protected int[] indexCols;		//index keys base column position array
 	public int rowsPerRead;
 	public boolean forUpdate;
@@ -163,6 +162,7 @@
 				resultSetNumber,
 				resultRowAllocator,
 				lockMode, tableLocked, isolationLevel,
+                colRefItem,
 				optimizerEstimatedRowCount,
 				optimizerEstimatedCost);
 
@@ -201,14 +201,6 @@
 		this.rowsPerRead = rowsPerRead;
 		this.oneRowScan = oneRowScan;
 
-		// retrieve the valid column list from
-		// the saved objects, if it exists
-		this.accessedCols = null;
-		if (colRefItem != -1)
-		{
-			this.accessedCols = (FormatableBitSet)(activation.getPreparedStatement().
-						getSavedObject(colRefItem));
-		}
 		if (indexColItem != -1)
 		{
 			this.indexCols = (int[])(activation.getPreparedStatement().



Mime
View raw message