]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Unwind some complex conditions in sqlite3BtreeDelete() into
authordrh <drh@noemail.net>
Sat, 11 Jul 2009 13:13:11 +0000 (13:13 +0000)
committerdrh <drh@noemail.net>
Sat, 11 Jul 2009 13:13:11 +0000 (13:13 +0000)
separate "if" statements. (CVS 6879)

FossilOrigin-Name: d99bde9ca61eeccfe6363ff0882fd4bcdb9a34dc

manifest
manifest.uuid
src/btree.c

index 3a73e28563cb38c17b762a0bd9b24b9594bd29c3..86d2320b485e1dbe90d84f211a1bba45b454dd68 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Remove\sanother\sunreachable\sbranch\sfrom\sbtree.c.\s(CVS\s6878)
-D 2009-07-11T11:45:23
+C Unwind\ssome\scomplex\sconditions\sin\ssqlite3BtreeDelete()\sinto\nseparate\s"if"\sstatements.\s(CVS\s6879)
+D 2009-07-11T13:13:12
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -106,7 +106,7 @@ F src/auth.c 802a9439dfa0b8c208b10055cba400e82ef18025
 F src/backup.c 6f1c2d9862c8a3feb7739dfcca02c1f5352e37f3
 F src/bitvec.c 0ef0651714728055d43de7a4cdd95e703fac0119
 F src/btmutex.c 9b899c0d8df3bd68f527b0afe03088321b696d3c
-F src/btree.c 0fd74216129d46963569974e5f130f4d430bc0f3
+F src/btree.c a080b574ea4b07df9deca83e0e38e8f08015a0ac
 F src/btree.h e53a10fd31d16c60a86f03c9467a6f470aa3683b
 F src/btreeInt.h a568bf057aa249eb06fd31358b4393a5ac88c118
 F src/build.c 867028ee9f63f7bc8eb8d4a720bb98cf9b9a12b4
@@ -740,7 +740,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
-P 709576c670f802bf4b6e5c0e8db2bbde2cc16a90
-R b051b6b029b2fee8203200a628dc9718
-U danielk1977
-Z 7c7dcb726643c689fb2026dd4d5cc411
+P b0853100a9f8e185e8d027502822337a79a2ba0c
+R 05d593da2e562ad999268c4d47bcf9b6
+U drh
+Z f7f774b2e1b61b0e01a61f9c5bfb1c62
index cadbe3b5f709a834fd077e1874f4fca10f1653ba..9b1e1d361bb026bc34c26666111043f4f16dbd6a 100644 (file)
@@ -1 +1 @@
-b0853100a9f8e185e8d027502822337a79a2ba0c
\ No newline at end of file
+d99bde9ca61eeccfe6363ff0882fd4bcdb9a34dc
\ No newline at end of file
index b214c3a699c9b8e412052572d9a266cf03ca66ec..af37d91474a76529261f1f778070ad49f3115673 100644 (file)
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.677 2009/07/11 11:45:23 danielk1977 Exp $
+** $Id: btree.c,v 1.678 2009/07/11 13:13:12 drh Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** See the header comment on "btreeInt.h" for additional information.
@@ -6551,14 +6551,16 @@ int sqlite3BtreeDelete(BtCursor *pCur){
   /* Save the positions of any other cursors open on this table before
   ** making any modifications. Make the page containing the entry to be 
   ** deleted writable. Then free any overflow pages associated with the 
-  ** entry and finally remove the cell itself from within the page.  */
-  if( SQLITE_OK!=(rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur))
-   || SQLITE_OK!=(rc = sqlite3PagerWrite(pPage->pDbPage))
-   || SQLITE_OK!=(rc = clearCell(pPage, pCell))
-   || SQLITE_OK!=(rc = dropCell(pPage, iCellIdx, cellSizePtr(pPage, pCell)))
-  ){
-    return rc;
-  }
+  ** entry and finally remove the cell itself from within the page.  
+  */
+  rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur);
+  if( rc ) return rc;
+  rc = sqlite3PagerWrite(pPage->pDbPage);
+  if( rc ) return rc;
+  rc = clearCell(pPage, pCell);
+  if( rc ) return rc;
+  rc = dropCell(pPage, iCellIdx, cellSizePtr(pPage, pCell));
+  if( rc ) return rc;
 
   /* If the cell deleted was not located on a leaf page, then the cursor
   ** is currently pointing to the largest entry in the sub-tree headed
@@ -6578,12 +6580,12 @@ int sqlite3BtreeDelete(BtCursor *pCur){
     allocateTempSpace(pBt);
     pTmp = pBt->pTmpSpace;
 
-    if( SQLITE_OK!=(rc = sqlite3PagerWrite(pLeaf->pDbPage)) 
-     || SQLITE_OK!=(rc = insertCell(pPage, iCellIdx, pCell-4, nCell+4, pTmp, n))
-     || SQLITE_OK!=(rc = dropCell(pLeaf, pLeaf->nCell-1, nCell))
-    ){
-      return rc;
-    }
+    rc = sqlite3PagerWrite(pLeaf->pDbPage);
+    if( rc ) return rc;
+    rc = insertCell(pPage, iCellIdx, pCell-4, nCell+4, pTmp, n);
+    if( rc ) return rc;
+    rc = dropCell(pLeaf, pLeaf->nCell-1, nCell);
+    if( rc ) return rc;
   }
 
   /* Balance the tree. If the entry deleted was located on a leaf page,