On 10/29/19, Keith Medcalf <kmedc...@dessus.com> wrote:
> Can the
> SQLITE_FUNC_CONSTANT attribute be added to the CURRENT_* functions since the
> value is constant during the running of a single statement?

No.  The functions used in generated tables must be pure.  They must
always give the same output given the same input.

datetime() is this way, as long as it's input does not use modifiers
like "now", or "localtime", or "utc".  And for that reason, datetime()
is marked as constant.  But it throws an error if you use it in a way
that gives a non-deterministic result.

Or, at least it is suppose to.  I just tried it and that mechanism is
not working correctly for generated columns, which is a bug.

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to