1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

Add the SQLITE_OMIT_TRUNCATE_OPTIMIZATION option. Other unrelated

documentation enhancements. (CVS 5798)

FossilOrigin-Name: fab4940d54fd1e5459a3d0d9b64b491e6972fd8d
This commit is contained in:
drh
2008-10-10 23:48:25 +00:00
parent 49ffdbf47e
commit f8cecdab84
5 changed files with 107 additions and 60 deletions

View File

@@ -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