aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/json1.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-01-04 01:43:02 +0000
committerdrh <drh@noemail.net>2020-01-04 01:43:02 +0000
commit79d5bc80c7d448955e7c1ee191e8f3a4b5920368 (patch)
treed70580f5e364f90c90addf6b0b02769bfd084e51 /ext/misc/json1.c
parent4be621e1ba6a5ef729cf4f90896b16421fc6a4e2 (diff)
downloadsqlite-79d5bc80c7d448955e7c1ee191e8f3a4b5920368.tar.gz
sqlite-79d5bc80c7d448955e7c1ee191e8f3a4b5920368.zip
Enhance PRAGMA function_list so that it shows all instances of each FuncDef,
the number of arguments, the encoding, the type, and the flags. Use this capability to locate and fix incorrect function flags in the standard build. FossilOrigin-Name: 9ca906d24a2e88eddb2fd067783512b66cfc49dce1596d816a1c38a09d128218
Diffstat (limited to 'ext/misc/json1.c')
-rw-r--r--ext/misc/json1.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/misc/json1.c b/ext/misc/json1.c
index 012ac4a89..006186b67 100644
--- a/ext/misc/json1.c
+++ b/ext/misc/json1.c
@@ -2581,16 +2581,19 @@ int sqlite3Json1Init(sqlite3 *db){
{ "json_tree", &jsonTreeModule },
};
#endif
+ static const int enc =
+ SQLITE_UTF8 |
+ SQLITE_DETERMINISTIC |
+ SQLITE_INNOCUOUS;
for(i=0; i<sizeof(aFunc)/sizeof(aFunc[0]) && rc==SQLITE_OK; i++){
- rc = sqlite3_create_function(db, aFunc[i].zName, aFunc[i].nArg,
- SQLITE_UTF8 | SQLITE_DETERMINISTIC,
+ rc = sqlite3_create_function(db, aFunc[i].zName, aFunc[i].nArg, enc,
(void*)&aFunc[i].flag,
aFunc[i].xFunc, 0, 0);
}
#ifndef SQLITE_OMIT_WINDOWFUNC
for(i=0; i<sizeof(aAgg)/sizeof(aAgg[0]) && rc==SQLITE_OK; i++){
rc = sqlite3_create_window_function(db, aAgg[i].zName, aAgg[i].nArg,
- SQLITE_SUBTYPE | SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
+ SQLITE_SUBTYPE | enc, 0,
aAgg[i].xStep, aAgg[i].xFinal,
aAgg[i].xValue, jsonGroupInverse, 0);
}