PureFunc Detection Fix

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

PureFunc Detection Fix

Keith Medcalf

The "not working" PureFunc detection is because the sqlite3NotPureFunc needs to be checked in isDate if it is called with 0 arguments (in which a single parameter of 'now' is assumed).  This should fix the purefunc detection for CHECK constraints and Indexes.

I still think that OP_Function should be used for generated always as ... stored and generated always as ... virtual columns rather than OP_PureFunc, and that the all the datetime functions should have the same SQLITE_SLOCHNG|SQLITE_FUNC_CONSTANT flags on them.

Creating an index on a generated always as ... stored should not be problematic, however allowing an index on a generated always as ... virtual that contains an impure function is indeed a problem -- I do not know how you would detect that.

The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.

sqlite-users mailing list
[hidden email]