aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authordrh <>2021-05-17 13:11:24 +0000
committerdrh <>2021-05-17 13:11:24 +0000
commitba39ca40588dfef1a07f172c20fac0197c01c0a2 (patch)
tree4ae3c5ac470ab103028e0f966685a394700261e9 /src/main.c
parent9430506df07923d22a4bd03973ff5671e76dfed4 (diff)
downloadsqlite-ba39ca40588dfef1a07f172c20fac0197c01c0a2.tar.gz
sqlite-ba39ca40588dfef1a07f172c20fac0197c01c0a2.zip
When deleting an SQL function that does not exist, return without doing
anything at all rather than creating a tombstone function. In this way, function deletes that happen inside virtual-table destructors that are run when a database connection is closing do not create new tombstones in the function table after the function table has already been purged. [forum:/forumpost/726219164b|forum post 726219164b]. FossilOrigin-Name: 391c73132c80df944fb49a17d8fe78203c54ac48f968ee9dd9dd8c769c0b4b10
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 785b646d2..bd92f7661 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1884,6 +1884,10 @@ int sqlite3CreateFunc(
}else{
sqlite3ExpirePreparedStatements(db, 0);
}
+ }else if( xSFunc==0 && xFinal==0 ){
+ /* Trying to delete a function that does not exist. This is a no-op.
+ ** https://sqlite.org/forum/forumpost/726219164b */
+ return SQLITE_OK;
}
p = sqlite3FindFunction(db, zFunctionName, nArg, (u8)enc, 1);