]> source.dussan.org Git - rspamd.git/commitdiff
Incompatible change: sqlite3 and per_user behaviour
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 11 Jan 2016 14:54:33 +0000 (14:54 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 11 Jan 2016 14:54:33 +0000 (14:54 +0000)
Now both redis and sqlite3 follows the common principles for per-user
statistics:

1) If per-user statistics is enabled check per-user tokens ONLY
2) If per-user statistics is not enabled then check common tokens ONLY

If you need old behaviour, then you'd need to use separate classifier
for per-user statistics.

src/libstat/backends/sqlite3_backend.c

index ab1d24a719cc1c1d430d6d2564e8c59cc524f65a..7000226e27ca6bdd58f51b11d8462f9e44378daa 100644 (file)
@@ -160,7 +160,7 @@ static struct rspamd_sqlite3_prstmt prepared_stmts[RSPAMD_STAT_BACKEND_MAX] =
                .sql = "SELECT value FROM tokens "
                                "LEFT JOIN languages ON tokens.language=languages.id "
                                "LEFT JOIN users ON tokens.user=users.id "
-                               "WHERE token=?1 AND (users.id=?2 OR users.id=0) "
+                               "WHERE token=?1 AND (users.id=?2) "
                                "AND (languages.id=?3 OR languages.id=0);",
                .stmt = NULL,
                .args = "III",