SQLite Forum

Regression: Mixing AND with OR results in no rows returned
Login
This seems to be a regression since some version of sqlite. I run this statement:

   $ sqlite3 contacts.db "select * from folder_id_email_list AS el WHERE (el.value IS NOT NULL AND el.value LIKE '%jackson.com')"

I get three rows, as expected, regardless of the version being used. When I just repeat the same expression concatenated with an OR, the result differs per version of the sqlite. As it's an OR, I should get the same result as with the above expression. The executed command:

   $ sqlite3 contacts.db "select * from folder_id_email_list AS el WHERE (el.value IS NOT NULL AND el.value LIKE '%jackson.com') OR (el.value IS NOT NULL AND el.value LIKE '%jackson.com')"

a) sqlite-3.33.0-1.fc32.x86_64 - works correctly
b) sqlite-3.34.1-1.fc33.x86_64 - works correctly
c) sqlite-3.35.4-1.fc35.x86_64 - returns no rows

Reproducer available here:

https://odubaj.fedorapeople.org/contacts.db

Reference:

https://bugzilla.redhat.com/show_bug.cgi?id=1947883