1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix JSON functions so that they work correctly under PRAGMA trusted_schema.

[forum:/forumpost/c88a671ad083d153|Forum thread c88a671ad083d153].

FossilOrigin-Name: 51a5d83c425d2e31508b73074d0076156817afb19003f847d16bf4a69ae5077b
This commit is contained in:
drh
2023-01-09 12:01:30 +00:00
parent 4ff47d3e37
commit 6791891f92
5 changed files with 32 additions and 15 deletions

View File

@@ -1848,7 +1848,7 @@ int sqlite3CreateFunc(
/* The SQLITE_INNOCUOUS flag is the same bit as SQLITE_FUNC_UNSAFE. But
** the meaning is inverted. So flip the bit. */
assert( SQLITE_FUNC_UNSAFE==SQLITE_INNOCUOUS );
extraFlags ^= SQLITE_FUNC_UNSAFE;
extraFlags ^= SQLITE_FUNC_UNSAFE; /* tag-20230109-1 */
#ifndef SQLITE_OMIT_UTF16
@@ -1866,11 +1866,11 @@ int sqlite3CreateFunc(
case SQLITE_ANY: {
int rc;
rc = sqlite3CreateFunc(db, zFunctionName, nArg,
(SQLITE_UTF8|extraFlags)^SQLITE_FUNC_UNSAFE,
(SQLITE_UTF8|extraFlags)^SQLITE_FUNC_UNSAFE, /* tag-20230109-1 */
pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor);
if( rc==SQLITE_OK ){
rc = sqlite3CreateFunc(db, zFunctionName, nArg,
(SQLITE_UTF16LE|extraFlags)^SQLITE_FUNC_UNSAFE,
(SQLITE_UTF16LE|extraFlags)^SQLITE_FUNC_UNSAFE, /* tag-20230109-1*/
pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor);
}
if( rc!=SQLITE_OK ){