Improved comments on the FORDELETE hint. No logic changes.

FossilOrigin-Name: a3cec529f0238e4ca1196fec420f2de80d28db78
This commit is contained in:
drh 2016-01-21 15:55:37 +00:00
parent b5a5a23e92
commit 9c0c57a4ca
5 changed files with 29 additions and 20 deletions

View File

@ -1,5 +1,5 @@
C Add\s'rbu'\sto\sthe\sclean\stargets.
D 2016-01-20T18:47:59.553
C Improved\scomments\son\sthe\sFORDELETE\shint.\s\sNo\slogic\schanges.
D 2016-01-21T15:55:37.704
F Makefile.in 7be88f5b473891e3a8c07245ed60535fcda4f9ee
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc c5ead4aa22ff6f528c755b07ed1e31184ac5b3d2
@ -289,7 +289,7 @@ F src/backup.c 2869a76c03eb393ee795416e2387005553df72bc
F src/bitvec.c 1a78d450a17c5016710eec900bedfc5729bf9bdf
F src/btmutex.c bc87dd3b062cc26edfe79918de2200ccb8d41e73
F src/btree.c f224ae877fde69d1a9d430f502edaf8502752dbe
F src/btree.h 68ef301795e00cdf1d3ab93abc44a43b7fe771e0
F src/btree.h 526137361963e746949ab966a910c7f455ac6b04
F src/btreeInt.h c18b7d2a3494695133e4e60ee36061d37f45d9a5
F src/build.c 31af80bba31ac159967951ef58f3144cc7db9d70
F src/callback.c 29ae4faba226c7ebb9aee93016b5ce8a8f071261
@ -350,7 +350,7 @@ F src/shell.c dcd7a83645ef2a58ee9c6d0ea4714d877d7835c4
F src/sqlite.h.in 214476a62012e578f42133a9a3b4f97a9aa421a3
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
F src/sqlite3ext.h dfbe62ffd95b99afe2140d8c35b180d11924072d
F src/sqliteInt.h 8c1debffeeb1579bdc264d54c72c05892e23b7ee
F src/sqliteInt.h 0403328581127bc8ad2f9cc7af2c3bb23d5316da
F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
F src/status.c 70912d7be68e9e2dbc4010c93d344af61d4c59ba
F src/table.c 51b46b2a62d1b3a959633d593b89bab5e2c9155e
@ -424,7 +424,7 @@ F src/vxworks.h 974e7d9a98f602d6310d563e1dc4e08f9fc48e47
F src/wal.c d21b99fd1458159d0b1ecdccc8ee6ada4fdc4c54
F src/wal.h 2f7c831cf3b071fa548bf2d5cac640846a7ff19c
F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354
F src/where.c bb69654f841ae7af0a20cc6fb8f0ac57901c31be
F src/where.c af9bf5dcec1a0e52726c550924aa91d837166251
F src/whereInt.h 78b6b4de94db84aecbdc07fe3e38f648eb391e9a
F src/wherecode.c 8dee26eb181ea9daa8b1a4d96f34c0860aaf99bd
F src/whereexpr.c 197a448b52073aee43eca3a2233fc113369eb2d4
@ -1419,7 +1419,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 81e830e21f81b6428209afa0b8f42f2fd9bd7aab
R 48465c96540143107ca11194f4f37f5c
U mistachkin
Z 6a809d8da8a8f3c2b9daa12aa587edb1
P f60f025027ab3acdbc97701f81ff9c11c8463022
R 58c662ebb54c7087fe70ba0b9b653627
U drh
Z 656e64b9ebb4ed29ac85ca9fad2e65b0

View File

@ -1 +1 @@
f60f025027ab3acdbc97701f81ff9c11c8463022
a3cec529f0238e4ca1196fec420f2de80d28db78

View File

@ -199,14 +199,24 @@ int sqlite3BtreeNewDb(Btree *p);
** Flags passed as the third argument to sqlite3BtreeCursor().
**
** For read-only cursors the wrFlag argument is always zero. For read-write
** cursors it may be set to either (BTREE_WRCSR|BTREE_FORDELETE) or
** (BTREE_WRCSR). If the BTREE_FORDELETE flag is set, then the cursor will
** cursors it may be set to either (BTREE_WRCSR|BTREE_FORDELETE) or just
** (BTREE_WRCSR). If the BTREE_FORDELETE bit is set, then the cursor will
** only be used by SQLite for the following:
**
** * to seek to and delete specific entries, and/or
** * to seek to and then delete specific entries, and/or
**
** * to read values that will be used to create keys that other
** BTREE_FORDELETE cursors will seek to and delete.
**
** The BTREE_FORDELETE flag is an optimization hint. It is not used by
** by this, the native b-tree engine of SQLite, but it is available to
** alternative storage engines that might be substituted in place of this
** b-tree system. For alternative storage engines in which a delete of
** the main table row automatically deletes corresponding index rows,
** the FORDELETE flag hint allows those alternative storage engines to
** skip a lot of work. Namely: FORDELETE cursors may treat all SEEK
** and DELETE operations as no-ops, and any READ operation against a
** FORDELETE cursor may return a null row: 0x01 0x00.
*/
#define BTREE_WRCSR 0x00000004 /* read-write cursor */
#define BTREE_FORDELETE 0x00000008 /* Cursor is for seek/delete only */

View File

@ -2857,7 +2857,7 @@ struct AuthContext {
#define OPFLAG_TYPEOFARG 0x80 /* OP_Column only used for typeof() */
#define OPFLAG_BULKCSR 0x01 /* OP_Open** used to open bulk cursor */
#define OPFLAG_SEEKEQ 0x02 /* OP_Open** cursor uses EQ seek only */
#define OPFLAG_FORDELETE 0x08 /* OP_Open is opening for-delete csr */
#define OPFLAG_FORDELETE 0x08 /* OP_Open should use BTREE_FORDELETE */
#define OPFLAG_P2ISREG 0x10 /* P2 to OP_Open** is a register number */
#define OPFLAG_PERMUTE 0x01 /* OP_Compare: use the permutation */

View File

@ -4014,7 +4014,7 @@ WhereInfo *sqlite3WhereBegin(
int ii; /* Loop counter */
sqlite3 *db; /* Database connection */
int rc; /* Return code */
u8 bFordelete = 0;
u8 bFordelete = 0; /* OPFLAG_FORDELETE or zero, as appropriate */
assert( (wctrlFlags & WHERE_ONEPASS_MULTIROW)==0 || (
(wctrlFlags & WHERE_ONEPASS_DESIRED)!=0
@ -4259,16 +4259,15 @@ WhereInfo *sqlite3WhereBegin(
/* If the caller is an UPDATE or DELETE statement that is requesting
** to use a one-pass algorithm, determine if this is appropriate.
** The one-pass algorithm only works if the WHERE clause constrains
** the statement to update or delete a single row.
*/
assert( (wctrlFlags & WHERE_ONEPASS_DESIRED)==0 || pWInfo->nLevel==1 );
if( (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 ){
int wsFlags = pWInfo->a[0].pWLoop->wsFlags;
int bOnerow = (wsFlags & WHERE_ONEROW)!=0;
if( bOnerow || ( (wctrlFlags & WHERE_ONEPASS_MULTIROW)
&& 0==(wsFlags & WHERE_VIRTUALTABLE)
)){
if( bOnerow
|| ((wctrlFlags & WHERE_ONEPASS_MULTIROW)!=0
&& 0==(wsFlags & WHERE_VIRTUALTABLE))
){
pWInfo->eOnePass = bOnerow ? ONEPASS_SINGLE : ONEPASS_MULTI;
if( HasRowid(pTabList->a[0].pTab) && (wsFlags & WHERE_IDX_ONLY) ){
if( wctrlFlags & WHERE_ONEPASS_MULTIROW ){