Correctly expand type code conditions in ground #171

Open
opened 2020-08-06 16:56:07 +00:00 by gburd · 0 comments
gburd commented 2020-08-06 16:56:07 +00:00 (Migrated from github.com)

At present we record the types of bindings, but if they're not already known, we don't impose an additional constraint. That leaves us with SQL like:

SELECT DISTINCT `all_datoms00`.e AS `?x` FROM `all_datoms` AS `all_datoms00`
WHERE NOT EXISTS (SELECT 1 WHERE `all_datoms00`.v = 5)

which is incorrect — the input was TypedValue::Long(5), but this will reject the fifth FTS string, entity ID 5, a moment in January 1970, and so on.

At present we _record_ the types of bindings, but if they're not already known, we don't impose an additional constraint. That leaves us with SQL like: ```sql SELECT DISTINCT `all_datoms00`.e AS `?x` FROM `all_datoms` AS `all_datoms00` WHERE NOT EXISTS (SELECT 1 WHERE `all_datoms00`.v = 5) ``` which is incorrect — the input was `TypedValue::Long(5)`, but this will reject the fifth FTS string, entity ID 5, a moment in January 1970, and so on.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/mentat#171
No description provided.