From 914929552c57f8d449caa0f053e3597c24f38bd6 Mon Sep 17 00:00:00 2001 From: SJ Date: Tue, 13 Dec 2016 21:25:39 +0100 Subject: [PATCH] sql fix for sphinx config Change-Id: I7a479014394f17a3cca6e18c7dc32fb8bb493398 Signed-off-by: SJ --- etc/sphinx.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/sphinx.conf.in b/etc/sphinx.conf.in index b1bb4fa1..37c984ee 100644 --- a/etc/sphinx.conf.in +++ b/etc/sphinx.conf.in @@ -18,7 +18,7 @@ source base source delta : base { sql_query_pre = SET NAMES utf8 - sql_query_pre = REPLACE INTO sph_counter SELECT 1, MAX(id) FROM sph_index + sql_query_pre = REPLACE INTO sph_counter SELECT 1, IFNULL(MAX(id), 0) FROM sph_index sql_query_post_index = DELETE FROM sph_index WHERE id<=(SELECT max_doc_id FROM sph_counter WHERE counter_id=1) sql_query = SELECT id, `from`, `to`, `fromdomain`, `todomain`, `subject`, `arrived`, `sent`, `body`, `size`, `direction`, `folder`, `attachments`, `attachment_types` FROM sph_index \ WHERE id <= (SELECT max_doc_id FROM sph_counter WHERE counter_id=1)