From 15fdaad8d0cd8a5a05f37f45dd4c5d50ec3a441e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 14 Jan 2016 23:51:42 +0000 Subject: [PATCH] Fix format argument for inserting shingles Issue: #478 --- src/libserver/fuzzy_backend.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libserver/fuzzy_backend.c b/src/libserver/fuzzy_backend.c index d3a3d947b..b52dae95a 100644 --- a/src/libserver/fuzzy_backend.c +++ b/src/libserver/fuzzy_backend.c @@ -76,6 +76,7 @@ static const char *create_tables_sql = "CREATE INDEX IF NOT EXISTS dgst_id ON shingles(digest_id);" "CREATE UNIQUE INDEX IF NOT EXISTS s ON shingles(value, number);" "COMMIT;"; +#if 0 static const char *create_index_sql = "BEGIN;" "CREATE UNIQUE INDEX IF NOT EXISTS d ON digests(digest);" @@ -83,6 +84,7 @@ static const char *create_index_sql = "CREATE INDEX IF NOT EXISTS dgst_id ON shingles(digest_id);" "CREATE UNIQUE INDEX IF NOT EXISTS s ON shingles(value, number);" "COMMIT;"; +#endif enum rspamd_fuzzy_statement_idx { RSPAMD_FUZZY_BACKEND_TRANSACTION_START = 0, RSPAMD_FUZZY_BACKEND_TRANSACTION_COMMIT, @@ -668,7 +670,7 @@ rspamd_fuzzy_backend_add (struct rspamd_fuzzy_backend *backend, for (i = 0; i < RSPAMD_SHINGLE_SIZE; i++) { rc = rspamd_fuzzy_backend_run_stmt (backend, TRUE, RSPAMD_FUZZY_BACKEND_INSERT_SHINGLE, - shcmd->sgl.hashes[i], i, id); + shcmd->sgl.hashes[i], (gint64)i, id); msg_debug_fuzzy_backend ("add shingle %d -> %L: %L", i, shcmd->sgl.hashes[i], -- 2.39.5