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 mi...@apache.org on 2006/11/17 17:07:36 UTC

svn commit: r476190 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StoredPage.java

Author: mikem
Date: Fri Nov 17 08:07:35 2006
New Revision: 476190

URL: http://svn.apache.org/viewvc?view=rev&rev=476190
Log:
DERBY-2093

Fixed error in initSlotTable() to print the right page info in case
of error during initialization of page from disk into cache.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StoredPage.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StoredPage.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StoredPage.java?view=diff&rev=476190&r1=476189&r2=476190
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StoredPage.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StoredPage.java Fri Nov 17 08:07:35 2006
@@ -795,7 +795,7 @@
 		try 
         {
 			readPageHeader();
-			initSlotTable();
+			initSlotTable(newIdentity);
 		}
         catch (IOException ioe) 
         {
@@ -2165,10 +2165,15 @@
      * BasePage.  Go through all the records on the page and set the 
      * freeSpace and firstFreeByte on page.
      * <p>
+     * @param newIdentity   The identity of the page we are trying to 
+     *                      initialize, since we are in the middle of trying
+     *                      to build the page existing info in the class is
+     *                      not set up yet (like getIdentity()). 
      *
 	 * @exception  StandardException  Standard exception policy.
      **/
-	private void initSlotTable() 
+	private void initSlotTable(
+    PageKey newIdentity)
         throws StandardException
 	{
 		int localSlotsInUse = slotsInUse;
@@ -2212,7 +2217,7 @@
                 {
                     throw dataFactory.markCorrupt(
                         StandardException.newException(
-                            SQLState.DATA_CORRUPT_PAGE, getPageId()));
+                            SQLState.DATA_CORRUPT_PAGE, newIdentity));
 				}
 
 				if (recordOffset > lastRecordOffset) 
@@ -2276,7 +2281,7 @@
 			// i/o methods on the byte array have thrown an IOException
             throw dataFactory.markCorrupt(
                 StandardException.newException(
-                    SQLState.DATA_CORRUPT_PAGE, ioe, getPageId()));
+                    SQLState.DATA_CORRUPT_PAGE, ioe, newIdentity));
 		}
 	}