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
When a search is started, SELECT MAX(id) FROM Events is executed and all queries thereafter are filtered to be less than this ID. This was added to avoid weird behavior when events were being added while a search was executing.
This query does not work when Events is empty, you get the following error message in that case: error when scanning max(id) in FilterStream: sql: Scan error on column index 0, name "MAX(id)": converting NULL to int is unsupported.
There are two ways I can imagine fixing this, the first one being to use a SELECT COUNT(1) FROM Events before issuing the MAX query, and the second being to do a string match on the error, similar to the expectedConstraintViolationForDuplicates check. I think the second option is preferable since the first one incurs a performance hit on all searches for an extreme edge case.
The text was updated successfully, but these errors were encountered:
When a search is started,
SELECT MAX(id) FROM Events
is executed and all queries thereafter are filtered to be less than this ID. This was added to avoid weird behavior when events were being added while a search was executing.This query does not work when Events is empty, you get the following error message in that case:
error when scanning max(id) in FilterStream: sql: Scan error on column index 0, name "MAX(id)": converting NULL to int is unsupported
.There are two ways I can imagine fixing this, the first one being to use a
SELECT COUNT(1) FROM Events
before issuing the MAX query, and the second being to do a string match on the error, similar to theexpectedConstraintViolationForDuplicates
check. I think the second option is preferable since the first one incurs a performance hit on all searches for an extreme edge case.The text was updated successfully, but these errors were encountered: