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

Enhance autoincrement so that it works with triggers that also do

autoincrement inserts, even multiple inserts into the same table.
Ticket #3928 (CVS 6807)

FossilOrigin-Name: 1330993de8eae7baeec24100216158063c9bdc19
This commit is contained in:
drh
2009-06-23 20:28:53 +00:00
parent 1c3d2bf9cf
commit 0b9f50d8aa
9 changed files with 252 additions and 82 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.203 2009/05/28 01:00:55 drh Exp $
** $Id: delete.c,v 1.204 2009/06/23 20:28:54 drh Exp $
*/
#include "sqliteInt.h"
@@ -475,6 +475,14 @@ void sqlite3DeleteFrom(
}
}
/* Update the sqlite_sequence table by storing the content of the
** maximum rowid counter values recorded while inserting into
** autoincrement tables.
*/
if( pParse->nested==0 && pParse->trigStack==0 ){
sqlite3AutoincrementEnd(pParse);
}
/*
** Return the number of rows that were deleted. If this routine is
** generating code because of a call to sqlite3NestedParse(), do not