]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Change the name of the BTREE_IDXDELETE flag to BTREE_AUXDELETE, to better
authordrh <drh@noemail.net>
Wed, 27 Jan 2016 16:26:25 +0000 (16:26 +0000)
committerdrh <drh@noemail.net>
Wed, 27 Jan 2016 16:26:25 +0000 (16:26 +0000)
reflect its purpose.

FossilOrigin-Name: 1d3bf6bebdda9f96734bc139601e9b05344ea0b4

manifest
manifest.uuid
src/btree.c
src/btree.h
src/delete.c
src/sqliteInt.h
src/vdbe.c

index dfebd3f6ae8328973780425a85fe46d85fa33f5d..9790c25453fbbeaa4439f86acecdb269edcb83d1 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\stests\sin\sfordelete.test\sto\stest\sfor\sthe\sBTREE_AUXDELETE\sflag.
-D 2016-01-27T16:17:41.726
+C Change\sthe\sname\sof\sthe\sBTREE_IDXDELETE\sflag\sto\sBTREE_AUXDELETE,\sto\sbetter\nreflect\sits\spurpose.
+D 2016-01-27T16:26:25.226
 F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 6fca5455aaecbd14479f33f091aa19df2d3d2969
@@ -290,8 +290,8 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240
 F src/backup.c 2869a76c03eb393ee795416e2387005553df72bc
 F src/bitvec.c 1a78d450a17c5016710eec900bedfc5729bf9bdf
 F src/btmutex.c bc87dd3b062cc26edfe79918de2200ccb8d41e73
-F src/btree.c 97cf881292e085ee71faf44f7167b6312965b562
-F src/btree.h c5dfbbc59226fa5fcc2b03befa85fe10ef23c1b5
+F src/btree.c 16edaf415a54a2fc9058e3bc47d0c894cd59635e
+F src/btree.h 368ceeb4bd9312dc8df2ffd64b4b7dbcf4db5f8e
 F src/btreeInt.h c18b7d2a3494695133e4e60ee36061d37f45d9a5
 F src/build.c b4eba1e84752ec9cae7ff3dacd5a8b6d1ab8deb9
 F src/callback.c 29ae4faba226c7ebb9aee93016b5ce8a8f071261
@@ -299,7 +299,7 @@ F src/complete.c addcd8160b081131005d5bc2d34adf20c1c5c92f
 F src/ctime.c 60e135af364d777a9ab41c97e5e89cd224da6198
 F src/date.c 997651e3ee6c2818fbf7fcdb7156cef9eb3ece20
 F src/dbstat.c b2ec6793eef97aebb4d171d490a4ffdfa9f2475c
-F src/delete.c db231a9895681efed007c0887e38b49f4d1291a5
+F src/delete.c 33ed87dc0746b1f8ce186f62b608bf40801af9c0
 F src/expr.c d10c1cdef5810cdbf73adc9f9b383684230b360a
 F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
 F src/fkey.c c66d3e5b35d4d95b5c1e2ee6c12f5df13a7f9ad6
@@ -352,7 +352,7 @@ F src/shell.c dcd7a83645ef2a58ee9c6d0ea4714d877d7835c4
 F src/sqlite.h.in 214476a62012e578f42133a9a3b4f97a9aa421a3
 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
 F src/sqlite3ext.h dfbe62ffd95b99afe2140d8c35b180d11924072d
-F src/sqliteInt.h 0faffdeed20201bedb202cf6ec07f14b29158c66
+F src/sqliteInt.h 12ec54454fc0f1c25f5c7057423ada1a363b6db0
 F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
 F src/status.c 70912d7be68e9e2dbc4010c93d344af61d4c59ba
 F src/table.c 51b46b2a62d1b3a959633d593b89bab5e2c9155e
@@ -412,7 +412,7 @@ F src/update.c 17332f9fe818cbc0444c36a811800af8498af4c3
 F src/utf.c 32d7f82aa921322f3e1c956f4b58f019ebd2c6b3
 F src/util.c 72d40df0a52d3f30b462a15f0e094fcbade6dc82
 F src/vacuum.c 2ddd5cad2a7b9cef7f9e431b8c7771634c6b1701
-F src/vdbe.c a27a3fdc65f5728c6e9bff49b6753fbf9d73c8c0
+F src/vdbe.c c367615fecb5fae8a39113ee2b6ecbab94e4bcd3
 F src/vdbe.h 7a733ea8aac1b77305a67698e784fa3484ee3337
 F src/vdbeInt.h 40c728712a2975855a2ac6aac44bf02dfd4a4c30
 F src/vdbeapi.c ffae8f5af4570fbd548504e815e9fb7227f0822e
@@ -1422,7 +1422,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P dde1db0dd2e2cf04706117629756c352b178ebb8
-R 112344660260002964aa8c335bb07305
-U dan
-Z e0043c886092534757bb67db359c02f9
+P bbd25cf179df5bda1fe729928d6746248f06e46f
+R 21474325914b9893f106ce3a1694990c
+U drh
+Z 6ce2f1bf15f4f84bace517d6cc10a5ac
index 2b4460a277444e110e253607c17d286fb3f24d2c..d16254398c5d4c79a53c7cc3bc207d2d5e7e1f97 100644 (file)
@@ -1 +1 @@
-bbd25cf179df5bda1fe729928d6746248f06e46f
\ No newline at end of file
+1d3bf6bebdda9f96734bc139601e9b05344ea0b4
\ No newline at end of file
index 89144e7a84e135c6bf791adb6a536097539d552a..04748e1b370a6ee91954d57de7adc4c449083478 100644 (file)
@@ -8098,9 +8098,12 @@ end_insert:
 ** the next call to BtreeNext() or BtreePrev() moves it to the same row
 ** as it would have been on if the call to BtreeDelete() had been omitted.
 **
-** The BTREE_IDXDELETE bit of flags indicates that this is a delete of
-** an index entry where the corresponding table row has already been deleted.
-** The BTREE_IDXDELETE bit is a hint that is not used by this implementation,
+** The BTREE_AUXDELETE bit of flags indicates that is one of several deletes
+** associated with a single table entry and its indexes.  Only one of those
+** deletes is considered the "primary" delete.  The primary delete occurs
+** on a cursor that is not a BTREE_FORDELETE cursor.  All but one delete
+** operation on non-FORDELETE cursors is tagged with the AUXDELETE flag.
+** The BTREE_AUXDELETE bit is a hint that is not used by this implementation,
 ** but which might be used by alternative storage engines.
 */
 int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){
@@ -8123,7 +8126,7 @@ int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){
   assert( !hasReadConflicts(p, pCur->pgnoRoot) );
   assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
   assert( pCur->eState==CURSOR_VALID );
-  assert( (flags & ~(BTREE_SAVEPOSITION | BTREE_IDXDELETE))==0 );
+  assert( (flags & ~(BTREE_SAVEPOSITION | BTREE_AUXDELETE))==0 );
 
   iCellDepth = pCur->iPage;
   iCellIdx = pCur->aiIdx[iCellDepth];
index 416faca65166c148dae2b01e2534b5cca885a2a3..30522e99e1930e78f24b89c35f6068188a55eac1 100644 (file)
@@ -249,7 +249,7 @@ int sqlite3BtreeDelete(BtCursor*, u8 flags);
 
 /* Allowed flags for the 2nd argument to sqlite3BtreeDelete() */
 #define BTREE_SAVEPOSITION 0x02  /* Leave cursor pointing at NEXT or PREV */
-#define BTREE_IDXDELETE    0x04  /* this is index, table row already deleted */
+#define BTREE_AUXDELETE    0x04  /* not the primary delete operation */
 
 int sqlite3BtreeInsert(BtCursor*, const void *pKey, i64 nKey,
                                   const void *pData, int nData,
index b3143c5f728067be96517b2666b537cf2d85f562..5b5a5e3cb1000e4fc4568d9f2f3a9bef0a676571 100644 (file)
@@ -724,12 +724,10 @@ void sqlite3GenerateRowDelete(
       sqlite3VdbeChangeP4(v, -1, pTab->zName, P4_TRANSIENT);
     }
     if( eMode!=ONEPASS_OFF ){
-      sqlite3VdbeChangeP5(v, OPFLAG_IDXDELETE);
-      p5 = OPFLAG_IDXDELETE;
+      sqlite3VdbeChangeP5(v, OPFLAG_AUXDELETE);
     }
     if( iIdxNoSeek>=0 ){
       sqlite3VdbeAddOp1(v, OP_Delete, iIdxNoSeek);
-      p5 = 0;
     }
     if( eMode==ONEPASS_MULTI ) p5 |= OPFLAG_SAVEPOSITION;
     sqlite3VdbeChangeP5(v, p5);
index 9aeffe216cd53f368c1a532af80f962210564173..364b7a352e729234caa29c08063fee8f36d0950c 100644 (file)
@@ -2862,7 +2862,7 @@ struct AuthContext {
 #define OPFLAG_P2ISREG       0x10    /* P2 to OP_Open** is a register number */
 #define OPFLAG_PERMUTE       0x01    /* OP_Compare: use the permutation */
 #define OPFLAG_SAVEPOSITION  0x02    /* OP_Delete: keep cursor position */
-#define OPFLAG_IDXDELETE     0x04    /* OP_Delete: index in a DELETE op */
+#define OPFLAG_AUXDELETE     0x04    /* OP_Delete: index in a DELETE op */
 
 /*
  * Each trigger present in the database schema is stored as an instance of
index 8583bcd4baa0be2d3e27fc3397acff25582c610a..f6a7946e6f4f57b35e3dd250495ea2d03146fedc 100644 (file)
@@ -553,7 +553,7 @@ int sqlite3VdbeExec(
   Op *pOrigOp;               /* Value of pOp at the top of the loop */
 #endif
 #ifdef SQLITE_DEBUG
-  int nExtraDelete = 0;      /* Verifies FORDELETE and IDXDELETE flags */
+  int nExtraDelete = 0;      /* Verifies FORDELETE and AUXDELETE flags */
 #endif
   int rc = SQLITE_OK;        /* Value to return */
   sqlite3 *db = p->db;       /* The database */
@@ -4355,9 +4355,11 @@ case OP_InsertInt: {
 ** OPFLAG_SAVEPOSITION bit of P5 is clear, then the cursor will be
 ** left in an undefined state.
 **
-** If the OPFLAG_IDXDELETE bit is set on P5, that indicates that this
-** delete is on an index cursor where the corresponding table row has
-** already been deleted.
+** If the OPFLAG_AUXDELETE bit is set on P5, that indicates that this
+** delete one of several associated with deleting a table row and all its
+** associated index entries.  Exactly one of those deletes is the "primary"
+** delete.  The others are all on OPFLAG_FORDELETE cursors or else are
+** marked with the AUXDELETE flag.
 **
 ** If the OPFLAG_NCHANGE flag of P2 (NB: P2 not P5) is set, then the row
 ** change count is incremented (otherwise not).
@@ -4397,14 +4399,14 @@ case OP_Delete: {
   }
 #endif
 
-  /* Only flags that can be set are SAVEPOISTION and IDXDELETE */ 
-  assert( (pOp->p5 & ~(OPFLAG_SAVEPOSITION|OPFLAG_IDXDELETE))==0 );
+  /* Only flags that can be set are SAVEPOISTION and AUXDELETE */ 
+  assert( (pOp->p5 & ~(OPFLAG_SAVEPOSITION|OPFLAG_AUXDELETE))==0 );
   assert( OPFLAG_SAVEPOSITION==BTREE_SAVEPOSITION );
-  assert( OPFLAG_IDXDELETE==BTREE_IDXDELETE );
+  assert( OPFLAG_AUXDELETE==BTREE_AUXDELETE );
 
 #ifdef SQLITE_DEBUG
   if( pC->isEphemeral==0
-   && (pOp->p5 & OPFLAG_IDXDELETE)==0
+   && (pOp->p5 & OPFLAG_AUXDELETE)==0
    && (pC->wrFlag & OPFLAG_FORDELETE)==0
   ){
     nExtraDelete++;
@@ -4963,7 +4965,7 @@ case OP_IdxDelete: {
     int i;
     for(i=0; i<r.nField; i++) assert( memIsValid(&r.aMem[i]) );
     if( pC->isEphemeral==0
-     && (pOp->p5 & OPFLAG_IDXDELETE)==0
+     && (pOp->p5 & OPFLAG_AUXDELETE)==0
      && (pC->wrFlag & OPFLAG_FORDELETE)==0
     ){
       nExtraDelete++;