blob: 770a40082697330a43e1dafa31189b1daebf9c95 [file] [log] [blame]
drhcce7d172000-05-31 15:34:51 +00001/*
drhb19a2bc2001-09-16 00:13:26 +00002** 2001 September 15
drhcce7d172000-05-31 15:34:51 +00003**
drhb19a2bc2001-09-16 00:13:26 +00004** The author disclaims copyright to this source code. In place of
5** a legal notice, here is a blessing:
drhcce7d172000-05-31 15:34:51 +00006**
drhb19a2bc2001-09-16 00:13:26 +00007** May you do good and not evil.
8** May you find forgiveness for yourself and forgive others.
9** May you share freely, never taking more than you give.
drhcce7d172000-05-31 15:34:51 +000010**
11*************************************************************************
12** This file contains C code routines that are called by the parser
13** to handle DELETE FROM statements.
14**
drhd24cc422003-03-27 12:51:24 +000015** $Id: delete.c,v 1.48 2003/03/27 12:51:24 drh Exp $
drhcce7d172000-05-31 15:34:51 +000016*/
17#include "sqliteInt.h"
18
drha76b5df2002-02-23 02:32:10 +000019
20/*
21** Given a table name, find the corresponding table and make sure the
22** table is writeable. Generate an error and return NULL if not. If
23** everything checks out, return a pointer to the Table structure.
24*/
drhd24cc422003-03-27 12:51:24 +000025Table *sqliteTableNameToTable(Parse *pParse, const char *zTab, const char *zDb){
drha76b5df2002-02-23 02:32:10 +000026 Table *pTab;
drhd24cc422003-03-27 12:51:24 +000027 pTab = sqliteFindTable(pParse->db, zTab, zDb);
drha76b5df2002-02-23 02:32:10 +000028 if( pTab==0 ){
drhd24cc422003-03-27 12:51:24 +000029 if( zDb==0 || zDb[0]==0 ){
30 sqliteSetString(&pParse->zErrMsg, "no such table: ", zTab, 0);
31 }else{
32 sqliteSetString(&pParse->zErrMsg, "no such table: ", zDb, ".", zTab, 0);
33 }
drha76b5df2002-02-23 02:32:10 +000034 pParse->nErr++;
35 return 0;
36 }
37 if( pTab->readOnly || pTab->pSelect ){
38 sqliteSetString(&pParse->zErrMsg,
39 pTab->pSelect ? "view " : "table ",
40 zTab,
41 " may not be modified", 0);
42 pParse->nErr++;
43 return 0;
44 }
45 return pTab;
46}
47
48/*
drhcce7d172000-05-31 15:34:51 +000049** Process a DELETE FROM statement.
50*/
51void sqliteDeleteFrom(
52 Parse *pParse, /* The parser context */
drh113088e2003-03-20 01:16:58 +000053 SrcList *pTabList, /* The table from which we should delete things */
drhcce7d172000-05-31 15:34:51 +000054 Expr *pWhere /* The WHERE clause. May be null */
55){
56 Vdbe *v; /* The virtual database engine */
57 Table *pTab; /* The table from which records will be deleted */
drhc977f7f2002-05-21 11:38:11 +000058 char *zTab; /* Name of the table from which we are deleting */
drhd24cc422003-03-27 12:51:24 +000059 char *zDb; /* Name of database containing table zTab */
drhcce7d172000-05-31 15:34:51 +000060 int end, addr; /* A couple addresses of generated code */
61 int i; /* Loop counter */
62 WhereInfo *pWInfo; /* Information about the WHERE clause */
63 Index *pIdx; /* For looping over indices of the table */
drh4794b982000-06-06 13:54:14 +000064 int base; /* Index of the first available table cursor */
drhecdc7532001-09-23 02:35:53 +000065 sqlite *db; /* Main database structure */
drh1bee3d72001-10-15 00:44:35 +000066
danielk1977c3f9bad2002-05-15 08:30:12 +000067 int row_triggers_exist = 0;
68 int oldIdx = -1;
drhcce7d172000-05-31 15:34:51 +000069
drhe5f9c642003-01-13 23:27:31 +000070 if( pParse->nErr || sqlite_malloc_failed ){
drhdaffd0e2001-04-11 14:28:42 +000071 pTabList = 0;
72 goto delete_from_cleanup;
73 }
drhecdc7532001-09-23 02:35:53 +000074 db = pParse->db;
drh113088e2003-03-20 01:16:58 +000075 assert( pTabList->nSrc==1 );
drhdaffd0e2001-04-11 14:28:42 +000076
danielk1977c3f9bad2002-05-15 08:30:12 +000077 /* Check for the special case of a VIEW with one or more ON DELETE triggers
danielk1977f29ce552002-05-19 23:43:12 +000078 ** defined
79 */
drh113088e2003-03-20 01:16:58 +000080 zTab = pTabList->a[0].zName;
drhd24cc422003-03-27 12:51:24 +000081 zDb = pTabList->a[0].zDatabase;
drhc977f7f2002-05-21 11:38:11 +000082 if( zTab != 0 ){
drhd24cc422003-03-27 12:51:24 +000083 pTab = sqliteFindTable(pParse->db, zTab, zDb);
drhc977f7f2002-05-21 11:38:11 +000084 if( pTab ){
85 row_triggers_exist =
86 sqliteTriggersExist(pParse, pTab->pTrigger,
87 TK_DELETE, TK_BEFORE, TK_ROW, 0) ||
88 sqliteTriggersExist(pParse, pTab->pTrigger,
89 TK_DELETE, TK_AFTER, TK_ROW, 0);
90 }
drhc977f7f2002-05-21 11:38:11 +000091 if( row_triggers_exist && pTab->pSelect ){
92 /* Just fire VIEW triggers */
drh113088e2003-03-20 01:16:58 +000093 sqliteSrcListDelete(pTabList);
drhc977f7f2002-05-21 11:38:11 +000094 sqliteViewTriggers(pParse, pTab, pWhere, OE_Replace, 0);
95 return;
danielk1977c3f9bad2002-05-15 08:30:12 +000096 }
97 }
98
drh1ccde152000-06-17 13:12:39 +000099 /* Locate the table which we want to delete. This table has to be
drhad3cab52002-05-24 02:04:32 +0000100 ** put in an SrcList structure because some of the subroutines we
drhcce7d172000-05-31 15:34:51 +0000101 ** will be calling are designed to work with multiple tables and expect
drhad3cab52002-05-24 02:04:32 +0000102 ** an SrcList* parameter instead of just a Table* parameter.
drhcce7d172000-05-31 15:34:51 +0000103 */
drhd24cc422003-03-27 12:51:24 +0000104 pTab = pTabList->a[0].pTab = sqliteTableNameToTable(pParse, zTab, zDb);
drh113088e2003-03-20 01:16:58 +0000105 if( pTab==0 ){
106 goto delete_from_cleanup;
107 }
drh417be792002-03-03 18:59:40 +0000108 assert( pTab->pSelect==0 ); /* This table is not a view */
drhe5f9c642003-01-13 23:27:31 +0000109 if( sqliteAuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0) ){
110 goto delete_from_cleanup;
111 }
drhcce7d172000-05-31 15:34:51 +0000112
drhc977f7f2002-05-21 11:38:11 +0000113 /* Allocate a cursor used to store the old.* data for a trigger.
114 */
danielk1977f29ce552002-05-19 23:43:12 +0000115 if( row_triggers_exist ){
danielk1977c3f9bad2002-05-15 08:30:12 +0000116 oldIdx = pParse->nTab++;
danielk1977f29ce552002-05-19 23:43:12 +0000117 }
danielk1977c3f9bad2002-05-15 08:30:12 +0000118
drh967e8b72000-06-21 13:59:10 +0000119 /* Resolve the column names in all the expressions.
drhcce7d172000-05-31 15:34:51 +0000120 */
drh832508b2002-03-02 17:04:07 +0000121 base = pParse->nTab++;
drhcce7d172000-05-31 15:34:51 +0000122 if( pWhere ){
drh832508b2002-03-02 17:04:07 +0000123 if( sqliteExprResolveIds(pParse, base, pTabList, 0, pWhere) ){
drhcce7d172000-05-31 15:34:51 +0000124 goto delete_from_cleanup;
125 }
126 if( sqliteExprCheck(pParse, pWhere, 0, 0) ){
127 goto delete_from_cleanup;
128 }
129 }
130
131 /* Begin generating code.
132 */
drhd8bc7082000-06-07 23:51:50 +0000133 v = sqliteGetVdbe(pParse);
danielk1977f29ce552002-05-19 23:43:12 +0000134 if( v==0 ){
135 goto delete_from_cleanup;
136 }
drhcabb0812002-09-14 13:47:32 +0000137 sqliteBeginWriteOperation(pParse, row_triggers_exist,
drhd24cc422003-03-27 12:51:24 +0000138 !row_triggers_exist && pTab->iDb==1);
drh5e00f6c2001-09-13 13:46:56 +0000139
drh1bee3d72001-10-15 00:44:35 +0000140 /* Initialize the counter of the number of rows deleted, if
141 ** we are counting rows.
142 */
143 if( db->flags & SQLITE_CountRows ){
144 sqliteVdbeAddOp(v, OP_Integer, 0, 0);
145 }
drhcce7d172000-05-31 15:34:51 +0000146
drh0353ced2001-03-20 22:05:00 +0000147 /* Special case: A DELETE without a WHERE clause deletes everything.
drhc977f7f2002-05-21 11:38:11 +0000148 ** It is easier just to erase the whole table. Note, however, that
149 ** this means that the row change count will be incorrect.
drhcce7d172000-05-31 15:34:51 +0000150 */
danielk1977f29ce552002-05-19 23:43:12 +0000151 if( pWhere==0 && !row_triggers_exist ){
drh1bee3d72001-10-15 00:44:35 +0000152 if( db->flags & SQLITE_CountRows ){
153 /* If counting rows deleted, just count the total number of
154 ** entries in the table. */
155 int endOfLoop = sqliteVdbeMakeLabel(v);
156 int addr;
drhd24cc422003-03-27 12:51:24 +0000157 sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0);
drh001bbcb2003-03-19 03:14:00 +0000158 sqliteVdbeAddOp(v, OP_OpenRead, base, pTab->tnum);
drh26b3e1b2002-07-19 18:52:40 +0000159 sqliteVdbeAddOp(v, OP_Rewind, base, sqliteVdbeCurrentAddr(v)+2);
drh6b563442001-11-07 16:48:26 +0000160 addr = sqliteVdbeAddOp(v, OP_AddImm, 1, 0);
drh26b3e1b2002-07-19 18:52:40 +0000161 sqliteVdbeAddOp(v, OP_Next, base, addr);
drh1bee3d72001-10-15 00:44:35 +0000162 sqliteVdbeResolveLabel(v, endOfLoop);
drh26b3e1b2002-07-19 18:52:40 +0000163 sqliteVdbeAddOp(v, OP_Close, base, 0);
drh1bee3d72001-10-15 00:44:35 +0000164 }
drhd24cc422003-03-27 12:51:24 +0000165 sqliteVdbeAddOp(v, OP_Clear, pTab->tnum, pTab->iDb);
drh0353ced2001-03-20 22:05:00 +0000166 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
drhd24cc422003-03-27 12:51:24 +0000167 sqliteVdbeAddOp(v, OP_Clear, pIdx->tnum, pIdx->iDb);
drhcce7d172000-05-31 15:34:51 +0000168 }
169 }
drh0353ced2001-03-20 22:05:00 +0000170
171 /* The usual case: There is a WHERE clause so we have to scan through
172 ** the table an pick which records to delete.
173 */
174 else{
175 /* Begin the database scan
176 */
drhe3184742002-06-19 14:27:05 +0000177 pWInfo = sqliteWhereBegin(pParse, base, pTabList, pWhere, 1, 0);
drh0353ced2001-03-20 22:05:00 +0000178 if( pWInfo==0 ) goto delete_from_cleanup;
179
180 /* Remember the key of every item to be deleted.
181 */
drh99fcd712001-10-13 01:06:47 +0000182 sqliteVdbeAddOp(v, OP_ListWrite, 0, 0);
drh1bee3d72001-10-15 00:44:35 +0000183 if( db->flags & SQLITE_CountRows ){
184 sqliteVdbeAddOp(v, OP_AddImm, 1, 0);
185 }
drh0353ced2001-03-20 22:05:00 +0000186
187 /* End the database scan loop.
188 */
189 sqliteWhereEnd(pWInfo);
190
191 /* Delete every item whose key was written to the list during the
192 ** database scan. We have to delete items after the scan is complete
193 ** because deleting an item can change the scan order.
194 */
drh99fcd712001-10-13 01:06:47 +0000195 sqliteVdbeAddOp(v, OP_ListRewind, 0, 0);
danielk1977c3f9bad2002-05-15 08:30:12 +0000196 end = sqliteVdbeMakeLabel(v);
197
drhc977f7f2002-05-21 11:38:11 +0000198 /* This is the beginning of the delete loop when there are
199 ** row triggers.
200 */
danielk1977f29ce552002-05-19 23:43:12 +0000201 if( row_triggers_exist ){
danielk1977c3f9bad2002-05-15 08:30:12 +0000202 addr = sqliteVdbeAddOp(v, OP_ListRead, 0, end);
203 sqliteVdbeAddOp(v, OP_Dup, 0, 0);
drhd24cc422003-03-27 12:51:24 +0000204 sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0);
drh001bbcb2003-03-19 03:14:00 +0000205 sqliteVdbeAddOp(v, OP_OpenRead, base, pTab->tnum);
danielk1977c3f9bad2002-05-15 08:30:12 +0000206 sqliteVdbeAddOp(v, OP_MoveTo, base, 0);
207 sqliteVdbeAddOp(v, OP_OpenTemp, oldIdx, 0);
208
209 sqliteVdbeAddOp(v, OP_Integer, 13, 0);
drhc977f7f2002-05-21 11:38:11 +0000210 for(i = 0; i<pTab->nCol; i++){
211 if( i==pTab->iPKey ){
drh9adf9ac2002-05-15 11:44:13 +0000212 sqliteVdbeAddOp(v, OP_Recno, base, 0);
danielk1977f29ce552002-05-19 23:43:12 +0000213 } else {
drhc977f7f2002-05-21 11:38:11 +0000214 sqliteVdbeAddOp(v, OP_Column, base, i);
danielk1977f29ce552002-05-19 23:43:12 +0000215 }
danielk1977c3f9bad2002-05-15 08:30:12 +0000216 }
217 sqliteVdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0);
218 sqliteVdbeAddOp(v, OP_PutIntKey, oldIdx, 0);
219 sqliteVdbeAddOp(v, OP_Close, base, 0);
220 sqliteVdbeAddOp(v, OP_Rewind, oldIdx, 0);
221
222 sqliteCodeRowTrigger(pParse, TK_DELETE, 0, TK_BEFORE, pTab, -1,
danielk19776f349032002-06-11 02:25:40 +0000223 oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default,
224 addr);
danielk1977c3f9bad2002-05-15 08:30:12 +0000225 }
226
drhc977f7f2002-05-21 11:38:11 +0000227 /* Open cursors for the table we are deleting from and all its
228 ** indices. If there are row triggers, this happens inside the
229 ** OP_ListRead loop because the cursor have to all be closed
230 ** before the trigger fires. If there are no row triggers, the
231 ** cursors are opened only once on the outside the loop.
232 */
danielk1977c3f9bad2002-05-15 08:30:12 +0000233 pParse->nTab = base + 1;
drhd24cc422003-03-27 12:51:24 +0000234 sqliteVdbeAddOp(v, OP_Integer, pTab->iDb, 0);
drh001bbcb2003-03-19 03:14:00 +0000235 sqliteVdbeAddOp(v, OP_OpenWrite, base, pTab->tnum);
drh0353ced2001-03-20 22:05:00 +0000236 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
drhd24cc422003-03-27 12:51:24 +0000237 sqliteVdbeAddOp(v, OP_Integer, pIdx->iDb, 0);
drh001bbcb2003-03-19 03:14:00 +0000238 sqliteVdbeAddOp(v, OP_OpenWrite, pParse->nTab++, pIdx->tnum);
drh0353ced2001-03-20 22:05:00 +0000239 }
danielk1977c3f9bad2002-05-15 08:30:12 +0000240
drhc977f7f2002-05-21 11:38:11 +0000241 /* This is the beginning of the delete loop when there are no
242 ** row triggers */
danielk1977f29ce552002-05-19 23:43:12 +0000243 if( !row_triggers_exist ){
danielk1977c3f9bad2002-05-15 08:30:12 +0000244 addr = sqliteVdbeAddOp(v, OP_ListRead, 0, end);
danielk1977f29ce552002-05-19 23:43:12 +0000245 }
danielk1977c3f9bad2002-05-15 08:30:12 +0000246
drhc977f7f2002-05-21 11:38:11 +0000247 /* Delete the row */
drh38640e12002-07-05 21:42:36 +0000248 sqliteGenerateRowDelete(db, v, pTab, base, pParse->trigStack==0);
danielk1977c3f9bad2002-05-15 08:30:12 +0000249
drhc977f7f2002-05-21 11:38:11 +0000250 /* If there are row triggers, close all cursors then invoke
251 ** the AFTER triggers
252 */
danielk1977f29ce552002-05-19 23:43:12 +0000253 if( row_triggers_exist ){
danielk1977c3f9bad2002-05-15 08:30:12 +0000254 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
drh9adf9ac2002-05-15 11:44:13 +0000255 sqliteVdbeAddOp(v, OP_Close, base + i, pIdx->tnum);
danielk1977c3f9bad2002-05-15 08:30:12 +0000256 }
257 sqliteVdbeAddOp(v, OP_Close, base, 0);
258 sqliteCodeRowTrigger(pParse, TK_DELETE, 0, TK_AFTER, pTab, -1,
danielk19776f349032002-06-11 02:25:40 +0000259 oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default,
260 addr);
danielk1977c3f9bad2002-05-15 08:30:12 +0000261 }
262
drhc977f7f2002-05-21 11:38:11 +0000263 /* End of the delete loop */
drh99fcd712001-10-13 01:06:47 +0000264 sqliteVdbeAddOp(v, OP_Goto, 0, addr);
265 sqliteVdbeResolveLabel(v, end);
drha8b38d22001-11-01 14:41:34 +0000266 sqliteVdbeAddOp(v, OP_ListReset, 0, 0);
danielk1977c3f9bad2002-05-15 08:30:12 +0000267
drhc977f7f2002-05-21 11:38:11 +0000268 /* Close the cursors after the loop if there are no row triggers */
danielk1977f29ce552002-05-19 23:43:12 +0000269 if( !row_triggers_exist ){
danielk1977c3f9bad2002-05-15 08:30:12 +0000270 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
drh9adf9ac2002-05-15 11:44:13 +0000271 sqliteVdbeAddOp(v, OP_Close, base + i, pIdx->tnum);
danielk1977c3f9bad2002-05-15 08:30:12 +0000272 }
273 sqliteVdbeAddOp(v, OP_Close, base, 0);
274 pParse->nTab = base;
275 }
drh0353ced2001-03-20 22:05:00 +0000276 }
drh1c928532002-01-31 15:54:21 +0000277 sqliteEndWriteOperation(pParse);
drh5e00f6c2001-09-13 13:46:56 +0000278
drh1bee3d72001-10-15 00:44:35 +0000279 /*
280 ** Return the number of rows that were deleted.
281 */
282 if( db->flags & SQLITE_CountRows ){
drh1bee3d72001-10-15 00:44:35 +0000283 sqliteVdbeAddOp(v, OP_ColumnName, 0, 0);
284 sqliteVdbeChangeP3(v, -1, "rows deleted", P3_STATIC);
285 sqliteVdbeAddOp(v, OP_Callback, 1, 0);
286 }
drhcce7d172000-05-31 15:34:51 +0000287
288delete_from_cleanup:
drhad3cab52002-05-24 02:04:32 +0000289 sqliteSrcListDelete(pTabList);
drhcce7d172000-05-31 15:34:51 +0000290 sqliteExprDelete(pWhere);
291 return;
292}
drh9cfcf5d2002-01-29 18:41:24 +0000293
294/*
295** This routine generates VDBE code that causes a single row of a
296** single table to be deleted.
297**
298** The VDBE must be in a particular state when this routine is called.
299** These are the requirements:
300**
301** 1. A read/write cursor pointing to pTab, the table containing the row
302** to be deleted, must be opened as cursor number "base".
303**
304** 2. Read/write cursors for all indices of pTab must be open as
305** cursor number base+i for the i-th index.
306**
307** 3. The record number of the row to be deleted must be on the top
308** of the stack.
309**
310** This routine pops the top of the stack to remove the record number
311** and then generates code to remove both the table record and all index
312** entries that point to that record.
313*/
314void sqliteGenerateRowDelete(
drh38640e12002-07-05 21:42:36 +0000315 sqlite *db, /* The database containing the index */
drh9cfcf5d2002-01-29 18:41:24 +0000316 Vdbe *v, /* Generate code into this VDBE */
317 Table *pTab, /* Table containing the row to be deleted */
drhc8d30ac2002-04-12 10:08:59 +0000318 int base, /* Cursor number for the table */
319 int count /* Increment the row change counter */
drh9cfcf5d2002-01-29 18:41:24 +0000320){
drh07d6e3a2002-05-23 12:50:18 +0000321 int addr;
322 addr = sqliteVdbeAddOp(v, OP_NotExists, base, 0);
drh38640e12002-07-05 21:42:36 +0000323 sqliteGenerateRowIndexDelete(db, v, pTab, base, 0);
drhc8d30ac2002-04-12 10:08:59 +0000324 sqliteVdbeAddOp(v, OP_Delete, base, count);
drh07d6e3a2002-05-23 12:50:18 +0000325 sqliteVdbeChangeP2(v, addr, sqliteVdbeCurrentAddr(v));
drh0ca3e242002-01-29 23:07:02 +0000326}
327
328/*
329** This routine generates VDBE code that causes the deletion of all
330** index entries associated with a single row of a single table.
331**
332** The VDBE must be in a particular state when this routine is called.
333** These are the requirements:
334**
335** 1. A read/write cursor pointing to pTab, the table containing the row
336** to be deleted, must be opened as cursor number "base".
337**
338** 2. Read/write cursors for all indices of pTab must be open as
339** cursor number base+i for the i-th index.
340**
341** 3. The "base" cursor must be pointing to the row that is to be
342** deleted.
343*/
344void sqliteGenerateRowIndexDelete(
drh38640e12002-07-05 21:42:36 +0000345 sqlite *db, /* The database containing the index */
drh0ca3e242002-01-29 23:07:02 +0000346 Vdbe *v, /* Generate code into this VDBE */
347 Table *pTab, /* Table containing the row to be deleted */
348 int base, /* Cursor number for the table */
349 char *aIdxUsed /* Only delete if aIdxUsed!=0 && aIdxUsed[i]!=0 */
350){
drh9cfcf5d2002-01-29 18:41:24 +0000351 int i;
352 Index *pIdx;
353
drh0ca3e242002-01-29 23:07:02 +0000354 for(i=1, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
355 int j;
356 if( aIdxUsed!=0 && aIdxUsed[i-1]==0 ) continue;
357 sqliteVdbeAddOp(v, OP_Recno, base, 0);
358 for(j=0; j<pIdx->nColumn; j++){
359 int idx = pIdx->aiColumn[j];
360 if( idx==pTab->iPKey ){
361 sqliteVdbeAddOp(v, OP_Dup, j, 0);
362 }else{
363 sqliteVdbeAddOp(v, OP_Column, base, idx);
drh9cfcf5d2002-01-29 18:41:24 +0000364 }
drh9cfcf5d2002-01-29 18:41:24 +0000365 }
drh0ca3e242002-01-29 23:07:02 +0000366 sqliteVdbeAddOp(v, OP_MakeIdxKey, pIdx->nColumn, 0);
drh491791a2002-07-18 00:34:09 +0000367 if( db->file_format>=4 ) sqliteAddIdxKeyType(v, pIdx);
drh0ca3e242002-01-29 23:07:02 +0000368 sqliteVdbeAddOp(v, OP_IdxDelete, base+i, 0);
drh9cfcf5d2002-01-29 18:41:24 +0000369 }
drh9cfcf5d2002-01-29 18:41:24 +0000370}