Thanks a ton for the replies. This pretty much confirms what I've been
suspecting.

On 3 February 2017 at 11:24, Clemens Ladisch <[email protected]> wrote:
> The FTS and R-tree virtual tables do not contain NULL values, so
> I guess it was never seen as necessary.

Does this make it an accidental omission, then? Would you guys be open
to implementing this type of constraint in the virtual table
interface?

On 3 February 2017 at 11:26, Hick Gunter <[email protected]> wrote:
> Notice that there is no SQLITE_INDEX_CONSTRAINT_NULL. You can of course 
> implement that "= NULL" works like "IS NULL" on your virtual table, but that 
> does result in some strange looking SQL, and you have to be sure to tell 
> SQLite to omit it's own constraint check. Alternatively, consider computed 
> virtual fields that will return 0 or 1 depending on the base field.
>
> In your table declaration, add <field>_IS_NULL INTEGER for all fields that 
> need to support this.
>
> SELECT ... FROM your_table WHERE ...<field>_IS_NULL = 1 ...
>
> This should make SQLite pass the constraint to xBestIndex and the value (0 or 
> 1, depending if you need IS NULL or NOT NULL) to xFilter.

I guess that would work. Thanks for the suggestion.

Kind regards,
Daniel
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to