1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

If an SQL function makes a recursive call to do an INSERT into the same

database, make sure that the last_insert_rowid() for that INSERT is recorded.

FossilOrigin-Name: e93aecc090c2a1d3c231bb2bde044886eff0bdf7
This commit is contained in:
drh
2014-09-26 01:10:02 +00:00
parent d863346194
commit 3b130beb15
4 changed files with 23 additions and 8 deletions

View File

@@ -1559,6 +1559,7 @@ case OP_Function: {
MemSetTypeFlag(ctx.pOut, MEM_Null);
ctx.fErrorOrAux = 0;
(*ctx.pFunc->xFunc)(&ctx, n, apVal); /* IMP: R-24505-23230 */
lastRowid = db->lastRowid; /* Remember rowid changes made by xFunc */
/* If the function returned an error, throw an exception */
if( ctx.fErrorOrAux ){