I was under the mistaken impression that SQLite's null-safe IS comparison operator was portable; in fact it is not at all so.
In order to keep queries portable, all use of IS needs to be replaced with =, and all references to folders need to be wrapped with COALESCE(). For example:
Bound parameters could also use our strict int type to cast nulls to zero instead of wrapping with COALESCE().
I was under the mistaken impression that SQLite's null-safe `IS` comparison operator was portable; in fact it is not at all so.
In order to keep queries portable, all use of `IS` needs to be replaced with `=`, and all references to folders need to be wrapped with `COALESCE()`. For example:
```sql
SELECT * from arsse_folders where coalesce(parent,0) = coalesce(?,0);
```
Bound parameters could also use our `strict int` type to cast nulls to zero instead of wrapping with `COALESCE()`.
I was under the mistaken impression that SQLite's null-safe
IS
comparison operator was portable; in fact it is not at all so.In order to keep queries portable, all use of
IS
needs to be replaced with=
, and all references to folders need to be wrapped withCOALESCE()
. For example:Bound parameters could also use our
strict int
type to cast nulls to zero instead of wrapping withCOALESCE()
.Use of IS operator in SQL queriesto Avoid use of IS operator in SQL queries 7 years ago