You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for making this library available, I found it useful.
Minor problem: Because you specify the SQLITE_ANY type in all five sqlite3_create_function() statements in digest.c, the digest functions cannot be used in expressions for generated stored columns. For example, the following table definition will fail:
$ sqlite3SQLite version 3.37.2 2022-01-06 13:25:41Enter ".help" for usage hints.Connected to a transient in-memory database.Use ".open FILENAME" to reopen on a persistent database.sqlite> CREATE TABLE messages ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, size INTEGER NOT NULL GENERATED ALWAYS AS (iif(data IS NULL, 0, length(data))) STORED, sha256 VARCHAR NOT NULL GENERATED ALWAYS AS (iif(data IS NULL, NULL, hex(digest(data, 'sha256')))) STORED, data BLOB);Error: in prepare, non-deterministic functions prohibited in generated columns (1)
The expression of a generated column may only reference constant literals and columns within the same row, and may only use scalar deterministic functions. The expression may not use subqueries, aggregate functions, window functions, or table-valued functions.
This issue should be resolved by changing SQLITE_ANY to SQLITE_INNOCUOUS|SQLITE_DETERMINISTIC for all five sqlite3_create_function() statements in digest.c.
The text was updated successfully, but these errors were encountered:
Thanks for making this library available, I found it useful.
Minor problem: Because you specify the
SQLITE_ANY
type in all fivesqlite3_create_function()
statements indigest.c
, the digest functions cannot be used in expressions for generated stored columns. For example, the following table definition will fail:This is in agreement with the SQLite documentation for generated columns:
This issue should be resolved by changing
SQLITE_ANY
toSQLITE_INNOCUOUS|SQLITE_DETERMINISTIC
for all fivesqlite3_create_function()
statements indigest.c
.The text was updated successfully, but these errors were encountered: