core: Fix SQL defaults for filtered backlog fetch
authorShane Synan <digitalcircuit36939@gmail.com>
Fri, 10 Jul 2020 21:50:59 +0000 (17:50 -0400)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 4 Oct 2020 15:01:02 +0000 (17:01 +0200)
commit68b12b0b035c460c7bab93959004bd83c0b160f2
treeb3617e4474aacad2e68b9c4517c35c4c5101a2e8
parent76883c546324b1fb80f465421d4e3c7732505852
core: Fix SQL defaults for filtered backlog fetch

Modify the SQL queries for *_filtered.sql backlog fetching to allow
specifying an invalid type of "0" or "-1" to match any message type.
This allows filtering backlog fetching by flag without restricting by
type.

Also modify the "= 0" check for :flag to "<= 0".  This matches the
function definitions and fixes specifying "-1" instead of "0".
Without this change, specifying "-1" will result in missing messages!

Committed separately from the new forward backlog fetching in case
issues are found, making reverting easier.
src/core/SQL/PostgreSQL/select_messagesAllNew_filtered.sql
src/core/SQL/PostgreSQL/select_messagesAll_filtered.sql
src/core/SQL/PostgreSQL/select_messagesNewerThan_filtered.sql
src/core/SQL/PostgreSQL/select_messagesNewestK_filtered.sql
src/core/SQL/PostgreSQL/select_messagesRange_filtered.sql
src/core/SQL/SQLite/select_messagesAllNew_filtered.sql
src/core/SQL/SQLite/select_messagesAll_filtered.sql
src/core/SQL/SQLite/select_messagesNewerThan_filtered.sql
src/core/SQL/SQLite/select_messagesNewestK_filtered.sql
src/core/SQL/SQLite/select_messagesRange_filtered.sql