diff options
Diffstat (limited to 'src/test8.c')
-rw-r--r-- | src/test8.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/test8.c b/src/test8.c index 847ae20f5..563d2799d 100644 --- a/src/test8.c +++ b/src/test8.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test8.c,v 1.23 2006/06/15 15:38:42 danielk1977 Exp $ +** $Id: test8.c,v 1.24 2006/06/16 06:17:47 danielk1977 Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -512,7 +512,12 @@ static void string_concat(char **pzStr, char *zAppend, int doFree){ ** NULL INTEGER (nCol args) INSERT (incl. rowid value) ** */ -int echoUpdate(sqlite3_vtab *tab, int nData, sqlite3_value **apData){ +int echoUpdate( + sqlite3_vtab *tab, + int nData, + sqlite3_value **apData, + sqlite_int64 *pRowid +){ echo_vtab *pVtab = (echo_vtab *)tab; sqlite3 *db = pVtab->db; int rc = SQLITE_OK; @@ -557,7 +562,7 @@ int echoUpdate(sqlite3_vtab *tab, int nData, sqlite3_value **apData){ int ii; char *zInsert = 0; char *zValues = 0; - + zInsert = sqlite3_mprintf("INSERT OR REPLACE INTO %Q (", pVtab->zTableName); if( sqlite3_value_type(apData[1])==SQLITE_INTEGER ){ bindArgOne = 1; @@ -602,6 +607,10 @@ int echoUpdate(sqlite3_vtab *tab, int nData, sqlite3_value **apData){ rc = sqlite3_finalize(pStmt); } + if( pRowid && rc==SQLITE_OK ){ + *pRowid = sqlite3_last_insert_rowid(db); + } + return rc; } |