db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r1339986 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Date Fri, 18 May 2012 06:03:24 GMT
Author: kristwaa
Date: Fri May 18 06:03:23 2012
New Revision: 1339986

URL: http://svn.apache.org/viewvc?rev=1339986&view=rev
Log:
DERBY-5746: Minor refactoring of DataDictionaryImpl.getSetAutoincrementValue 

Add debug asserts for two cases where the return value of
ConglomerateController.fetch is ignored (primarily for consistency with other
cases).

Patch file: derby-5746-2a-assert_on_fetch.diff


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=1339986&r1=1339985&r2=1339986&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Fri May 18 06:03:23 2012
@@ -8873,7 +8873,12 @@ public final class	DataDictionaryImpl
                     TransactionController.ISOLATION_REPEATABLE_READ);
 
             // fetch the current value
-            heapCC.fetch(rl, row.getRowArray(), columnToRead, wait);
+            boolean baseRowExists =
+                    heapCC.fetch(rl, row.getRowArray(), columnToRead, wait);
+            if (SanityManager.DEBUG) {
+                // We're not prepared for a non-existing base row.
+                SanityManager.ASSERT(baseRowExists, "base row not found");
+            }
 
             // while the Row interface is 1 based.
             NumberDataValue currentAI = (NumberDataValue)row.getColumn(columnNum);
@@ -10380,7 +10385,12 @@ public final class	DataDictionaryImpl
                     TransactionController.MODE_RECORD,
                     TransactionController.ISOLATION_REPEATABLE_READ);
 
-            heapCC.fetch( rowLocation, row.getRowArray(), columnToUpdate, wait );
+            boolean baseRowExists = heapCC.fetch(
+                    rowLocation, row.getRowArray(), columnToUpdate, wait);
+            if (SanityManager.DEBUG) {
+                // We're not prepared for a non-existing base row.
+                SanityManager.ASSERT(baseRowExists, "base row not found");
+            }
 
 			NumberDataValue oldValueOnDisk = (NumberDataValue) row.getColumn( columnNum );
 



Mime
View raw message