diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-08 16:55:33 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-08 16:59:00 +0100 |
commit | f803de985a63f31321f3f4fcbed656b692d7d756 (patch) | |
tree | dac801e4b40a8bc22f123f8feac32a2753a3662d /src/libstat | |
parent | 0f2a9c864ae48f3bef4e2e928b761fb4de3b4026 (diff) | |
download | rspamd-f803de985a63f31321f3f4fcbed656b692d7d756.tar.gz rspamd-f803de985a63f31321f3f4fcbed656b692d7d756.zip |
[Minor] Joins cleanup
Issue: #2251
Submitted by: @beiDei8z
Diffstat (limited to 'src/libstat')
-rw-r--r-- | src/libstat/backends/sqlite3_backend.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libstat/backends/sqlite3_backend.c b/src/libstat/backends/sqlite3_backend.c index 8a3dcdc0c..5b5a6b896 100644 --- a/src/libstat/backends/sqlite3_backend.c +++ b/src/libstat/backends/sqlite3_backend.c @@ -151,10 +151,8 @@ static struct rspamd_sqlite3_prstmt prepared_stmts[RSPAMD_STAT_BACKEND_MAX] = [RSPAMD_STAT_BACKEND_GET_TOKEN] = { .idx = RSPAMD_STAT_BACKEND_GET_TOKEN, .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) " - "AND (languages.id=?3 OR languages.id=0);", + "WHERE token=?1 AND users=?2 " + "AND (language=?3 OR language=0);", .stmt = NULL, .args = "III", .result = SQLITE_ROW, |