diff options
author | drh <drh@noemail.net> | 2008-10-10 23:48:25 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-10-10 23:48:25 +0000 |
commit | f8cecdab84f479e11f2e5e70b4fef58e9b438230 (patch) | |
tree | 7857c7a27310267a5dd68e82714a04c1f7721731 /src/delete.c | |
parent | 49ffdbf47e45d2192c4211ee3ec1886884f1b073 (diff) | |
download | sqlite-f8cecdab84f479e11f2e5e70b4fef58e9b438230.tar.gz sqlite-f8cecdab84f479e11f2e5e70b4fef58e9b438230.zip |
Add the SQLITE_OMIT_TRUNCATE_OPTIMIZATION option. Other unrelated
documentation enhancements. (CVS 5798)
FossilOrigin-Name: fab4940d54fd1e5459a3d0d9b64b491e6972fd8d
Diffstat (limited to 'src/delete.c')
-rw-r--r-- | src/delete.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/delete.c b/src/delete.c index 7f98812a6..0c0666529 100644 --- a/src/delete.c +++ b/src/delete.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** in order to generate code for DELETE FROM statements. ** -** $Id: delete.c,v 1.181 2008/10/10 18:25:46 shane Exp $ +** $Id: delete.c,v 1.182 2008/10/10 23:48:26 drh Exp $ */ #include "sqliteInt.h" @@ -364,6 +364,7 @@ void sqlite3DeleteFrom( sqlite3VdbeAddOp2(v, OP_Integer, 0, memCnt); } +#ifndef SQLITE_OMIT_TRUNCATE_OPTIMIZATION /* Special case: A DELETE without a WHERE clause deletes everything. ** It is easier just to erase the whole table. Note, however, that ** this means that the row change count will be incorrect. @@ -391,11 +392,12 @@ void sqlite3DeleteFrom( sqlite3VdbeAddOp2(v, OP_Clear, pIdx->tnum, iDb); } } - } + }else +#endif /* SQLITE_OMIT_TRUNCATE_OPTIMIZATION */ /* The usual case: There is a WHERE clause so we have to scan through ** the table and pick which records to delete. */ - else{ + { int iRowid = ++pParse->nMem; /* Used for storing rowid values. */ /* Begin the database scan |