diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e743f994..933fc94c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: env: SQLITE_RELEASE_YEAR: "2021" - SQLITE_VERSION: "3340100" + SQLITE_VERSION: "3360000" jobs: build: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9b2f2d4d..bc078fe5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,7 +7,7 @@ on: env: SQLITE_RELEASE_YEAR: "2021" - SQLITE_VERSION: "3340100" + SQLITE_VERSION: "3360000" jobs: publish: diff --git a/src/sqlite3-crypto.c b/src/sqlite3-crypto.c index 3650addd..65980600 100644 --- a/src/sqlite3-crypto.c +++ b/src/sqlite3-crypto.c @@ -100,16 +100,17 @@ __declspec(dllexport) const sqlite3_api_routines *pApi) { SQLITE_EXTENSION_INIT2(pApi); + static const int flags = SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC; int err_count = 0; err_count += - sqlite3_create_function(db, "md5", 1, SQLITE_UTF8, (void *)5, sqlite3_hash, 0, 0); + sqlite3_create_function(db, "md5", 1, flags, (void *)5, sqlite3_hash, 0, 0); err_count += - sqlite3_create_function(db, "sha1", 1, SQLITE_UTF8, (void *)1, sqlite3_hash, 0, 0); + sqlite3_create_function(db, "sha1", 1, flags, (void *)1, sqlite3_hash, 0, 0); err_count += - sqlite3_create_function(db, "sha256", -1, SQLITE_UTF8, (void *)2256, sqlite3_hash, 0, 0); + sqlite3_create_function(db, "sha256", -1, flags, (void *)2256, sqlite3_hash, 0, 0); err_count += - sqlite3_create_function(db, "sha384", -1, SQLITE_UTF8, (void *)2384, sqlite3_hash, 0, 0); + sqlite3_create_function(db, "sha384", -1, flags, (void *)2384, sqlite3_hash, 0, 0); err_count += - sqlite3_create_function(db, "sha512", -1, SQLITE_UTF8, (void *)2512, sqlite3_hash, 0, 0); + sqlite3_create_function(db, "sha512", -1, flags, (void *)2512, sqlite3_hash, 0, 0); return err_count ? SQLITE_ERROR : SQLITE_OK; } \ No newline at end of file diff --git a/src/sqlite3-math.c b/src/sqlite3-math.c index bff567fe..ce51951c 100644 --- a/src/sqlite3-math.c +++ b/src/sqlite3-math.c @@ -217,36 +217,37 @@ __declspec(dllexport) sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi) { + static const int flags = SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC; SQLITE_EXTENSION_INIT2(pApi); - sqlite3_create_function(db, "ceil", 1, SQLITE_UTF8, xCeil, ceilingFunc, 0, 0); - sqlite3_create_function(db, "ceiling", 1, SQLITE_UTF8, xCeil, ceilingFunc, 0, 0); - sqlite3_create_function(db, "floor", 1, SQLITE_UTF8, xFloor, ceilingFunc, 0, 0); - sqlite3_create_function(db, "trunc", 1, SQLITE_UTF8, trunc, ceilingFunc, 0, 0); - sqlite3_create_function(db, "ln", 1, SQLITE_UTF8, 0, log1Func, 0, 0); - sqlite3_create_function(db, "log", 1, SQLITE_UTF8, (void *)(1), log1Func, 0, 0); - sqlite3_create_function(db, "log10", 1, SQLITE_UTF8, (void *)(1), log1Func, 0, 0); - sqlite3_create_function(db, "log2", 1, SQLITE_UTF8, (void *)(2), log1Func, 0, 0); - sqlite3_create_function(db, "log", 2, SQLITE_UTF8, 0, log2Func, 0, 0); - sqlite3_create_function(db, "exp", 1, SQLITE_UTF8, exp, math1Func, 0, 0); - sqlite3_create_function(db, "pow", 2, SQLITE_UTF8, pow, math2Func, 0, 0); - sqlite3_create_function(db, "power", 2, SQLITE_UTF8, pow, math2Func, 0, 0); - sqlite3_create_function(db, "mod", 2, SQLITE_UTF8, fmod, math2Func, 0, 0); - sqlite3_create_function(db, "acos", 1, SQLITE_UTF8, acos, math1Func, 0, 0); - sqlite3_create_function(db, "asin", 1, SQLITE_UTF8, asin, math1Func, 0, 0); - sqlite3_create_function(db, "atan", 1, SQLITE_UTF8, atan, math1Func, 0, 0); - sqlite3_create_function(db, "atan2", 2, SQLITE_UTF8, atan2, math2Func, 0, 0); - sqlite3_create_function(db, "cos", 1, SQLITE_UTF8, cos, math1Func, 0, 0); - sqlite3_create_function(db, "sin", 1, SQLITE_UTF8, sin, math1Func, 0, 0); - sqlite3_create_function(db, "tan", 1, SQLITE_UTF8, tan, math1Func, 0, 0); - sqlite3_create_function(db, "cosh", 1, SQLITE_UTF8, cosh, math1Func, 0, 0); - sqlite3_create_function(db, "sinh", 1, SQLITE_UTF8, sinh, math1Func, 0, 0); - sqlite3_create_function(db, "tanh", 1, SQLITE_UTF8, tanh, math1Func, 0, 0); - sqlite3_create_function(db, "acosh", 1, SQLITE_UTF8, acosh, math1Func, 0, 0); - sqlite3_create_function(db, "asinh", 1, SQLITE_UTF8, asinh, math1Func, 0, 0); - sqlite3_create_function(db, "atanh", 1, SQLITE_UTF8, atanh, math1Func, 0, 0); - sqlite3_create_function(db, "sqrt", 1, SQLITE_UTF8, sqrt, math1Func, 0, 0); - sqlite3_create_function(db, "radians", 1, SQLITE_UTF8, degToRad, math1Func, 0, 0); - sqlite3_create_function(db, "degrees", 1, SQLITE_UTF8, radToDeg, math1Func, 0, 0); - sqlite3_create_function(db, "pi", 0, SQLITE_UTF8, 0, piFunc, 0, 0); + sqlite3_create_function(db, "ceil", 1, flags, xCeil, ceilingFunc, 0, 0); + sqlite3_create_function(db, "ceiling", 1, flags, xCeil, ceilingFunc, 0, 0); + sqlite3_create_function(db, "floor", 1, flags, xFloor, ceilingFunc, 0, 0); + sqlite3_create_function(db, "trunc", 1, flags, trunc, ceilingFunc, 0, 0); + sqlite3_create_function(db, "ln", 1, flags, 0, log1Func, 0, 0); + sqlite3_create_function(db, "log", 1, flags, (void *)(1), log1Func, 0, 0); + sqlite3_create_function(db, "log10", 1, flags, (void *)(1), log1Func, 0, 0); + sqlite3_create_function(db, "log2", 1, flags, (void *)(2), log1Func, 0, 0); + sqlite3_create_function(db, "log", 2, flags, 0, log2Func, 0, 0); + sqlite3_create_function(db, "exp", 1, flags, exp, math1Func, 0, 0); + sqlite3_create_function(db, "pow", 2, flags, pow, math2Func, 0, 0); + sqlite3_create_function(db, "power", 2, flags, pow, math2Func, 0, 0); + sqlite3_create_function(db, "mod", 2, flags, fmod, math2Func, 0, 0); + sqlite3_create_function(db, "acos", 1, flags, acos, math1Func, 0, 0); + sqlite3_create_function(db, "asin", 1, flags, asin, math1Func, 0, 0); + sqlite3_create_function(db, "atan", 1, flags, atan, math1Func, 0, 0); + sqlite3_create_function(db, "atan2", 2, flags, atan2, math2Func, 0, 0); + sqlite3_create_function(db, "cos", 1, flags, cos, math1Func, 0, 0); + sqlite3_create_function(db, "sin", 1, flags, sin, math1Func, 0, 0); + sqlite3_create_function(db, "tan", 1, flags, tan, math1Func, 0, 0); + sqlite3_create_function(db, "cosh", 1, flags, cosh, math1Func, 0, 0); + sqlite3_create_function(db, "sinh", 1, flags, sinh, math1Func, 0, 0); + sqlite3_create_function(db, "tanh", 1, flags, tanh, math1Func, 0, 0); + sqlite3_create_function(db, "acosh", 1, flags, acosh, math1Func, 0, 0); + sqlite3_create_function(db, "asinh", 1, flags, asinh, math1Func, 0, 0); + sqlite3_create_function(db, "atanh", 1, flags, atanh, math1Func, 0, 0); + sqlite3_create_function(db, "sqrt", 1, flags, sqrt, math1Func, 0, 0); + sqlite3_create_function(db, "radians", 1, flags, degToRad, math1Func, 0, 0); + sqlite3_create_function(db, "degrees", 1, flags, radToDeg, math1Func, 0, 0); + sqlite3_create_function(db, "pi", 0, flags, 0, piFunc, 0, 0); return SQLITE_OK; } \ No newline at end of file diff --git a/src/sqlite3-stats.c b/src/sqlite3-stats.c index ae0b2599..88f58a94 100644 --- a/src/sqlite3-stats.c +++ b/src/sqlite3-stats.c @@ -485,32 +485,33 @@ __declspec(dllexport) char **pzErrMsg, const sqlite3_api_routines *pApi) { SQLITE_EXTENSION_INIT2(pApi); + static const int flags = SQLITE_UTF8 | SQLITE_INNOCUOUS; int err_count = 0; err_count += sqlite3_create_function( - db, "stddev", 1, SQLITE_UTF8, 0, 0, varianceStep, stddevFinalize); + db, "stddev", 1, flags, 0, 0, varianceStep, stddevFinalize); err_count += sqlite3_create_function( - db, "stddev_samp", 1, SQLITE_UTF8, 0, 0, varianceStep, stddevFinalize); + db, "stddev_samp", 1, flags, 0, 0, varianceStep, stddevFinalize); err_count += sqlite3_create_function( - db, "stddev_pop", 1, SQLITE_UTF8, 0, 0, varianceStep, stddevpopFinalize); + db, "stddev_pop", 1, flags, 0, 0, varianceStep, stddevpopFinalize); err_count += sqlite3_create_function( - db, "variance", 1, SQLITE_UTF8, 0, 0, varianceStep, varianceFinalize); + db, "variance", 1, flags, 0, 0, varianceStep, varianceFinalize); err_count += sqlite3_create_function( - db, "var_samp", 1, SQLITE_UTF8, 0, 0, varianceStep, varianceFinalize); + db, "var_samp", 1, flags, 0, 0, varianceStep, varianceFinalize); err_count += sqlite3_create_function( - db, "var_pop", 1, SQLITE_UTF8, 0, 0, varianceStep, variancepopFinalize); + db, "var_pop", 1, flags, 0, 0, varianceStep, variancepopFinalize); err_count += sqlite3_create_function( - db, "mode", 1, SQLITE_UTF8, 0, 0, modeStep, modeFinalize); + db, "mode", 1, flags, 0, 0, modeStep, modeFinalize); err_count += sqlite3_create_function( - db, "median", 1, SQLITE_UTF8, 0, 0, modeStep, medianFinalize); + db, "median", 1, flags, 0, 0, modeStep, medianFinalize); err_count += sqlite3_create_function( - db, "percentile_25", 1, SQLITE_UTF8, 0, 0, modeStep, percentile_25Finalize); + db, "percentile_25", 1, flags, 0, 0, modeStep, percentile_25Finalize); err_count += sqlite3_create_function( - db, "percentile_75", 1, SQLITE_UTF8, 0, 0, modeStep, percentile_75Finalize); + db, "percentile_75", 1, flags, 0, 0, modeStep, percentile_75Finalize); err_count += sqlite3_create_function( - db, "percentile_90", 1, SQLITE_UTF8, 0, 0, modeStep, percentile_90Finalize); + db, "percentile_90", 1, flags, 0, 0, modeStep, percentile_90Finalize); err_count += sqlite3_create_function( - db, "percentile_95", 1, SQLITE_UTF8, 0, 0, modeStep, percentile_95Finalize); + db, "percentile_95", 1, flags, 0, 0, modeStep, percentile_95Finalize); err_count += sqlite3_create_function( - db, "percentile_99", 1, SQLITE_UTF8, 0, 0, modeStep, percentile_99Finalize); + db, "percentile_99", 1, flags, 0, 0, modeStep, percentile_99Finalize); return err_count ? SQLITE_ERROR : SQLITE_OK; } \ No newline at end of file diff --git a/src/sqlite3-text.c b/src/sqlite3-text.c index acd3e4b5..25bacfb0 100644 --- a/src/sqlite3-text.c +++ b/src/sqlite3-text.c @@ -223,7 +223,8 @@ __declspec(dllexport) char **pzErrMsg, const sqlite3_api_routines *pApi) { SQLITE_EXTENSION_INIT2(pApi); - sqlite3_create_function(db, "reverse", 1, SQLITE_UTF8, 0, sqlite3_reverse, 0, 0); - sqlite3_create_function(db, "split_part", 3, SQLITE_UTF8, 0, sqlite3_split_part, 0, 0); + static const int flags = SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC; + sqlite3_create_function(db, "reverse", 1, flags, 0, sqlite3_reverse, 0, 0); + sqlite3_create_function(db, "split_part", 3, flags, 0, sqlite3_split_part, 0, 0); return SQLITE_OK; } \ No newline at end of file