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
the COMPAT matrix claims BETWEEN doesn't work, but the query seems to.
this is because before getting to translate_condition_expr(), we seem to have parsed this to the equivalent comparisons. Printing Expr right at the beginning of the function for the query
SELECT id, value FROM demo WHERE id BETWEEN 2 AND 4;
Yes we made a decision in #490 to (temporarily) accept an extra bytecode instruction for the benefit of being able to rewrite BETWEEN entirely as inequality comparisons. As Diego said there's a discussion in that PR about the way forward. We do have limited support for indexes already, but we don't implement what SQLite does, which is:
Thus if the BETWEEN term is not used as an index constraint and instead must be used to test input rows, the expr1 expression is only evaluated once.
jussisaurio
changed the title
BETWEEN operator accidentally works, but generates different bytecode than SQLite
BETWEEN operator generates different bytecode than SQLite
Feb 2, 2025
the COMPAT matrix claims BETWEEN doesn't work, but the query seems to.
this is because before getting to translate_condition_expr(), we seem to have parsed this to the equivalent comparisons. Printing Expr right at the beginning of the function for the query
yields
As a result, while SQLite ends up generating this bytecode:
we generate:
The text was updated successfully, but these errors were encountered: