From 1cffdb2d337576171b9941c32b1b1aca91a69b0e Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 21 Apr 2007 03:19:23 +0000 Subject: [PATCH] can't be negative git-svn-id: file:///svn/phpbb/trunk@7378 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/search/fulltext_native.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 35c1d9f24d..0af987efab 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1160,7 +1160,8 @@ class fulltext_native extends search_backend $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' SET word_count = word_count - 1 - WHERE ' . $db->sql_in_set('word_id', $sql_in); + WHERE ' . $db->sql_in_set('word_id', $sql_in) . ' + AND word_count > 0'; $db->sql_query($sql); unset($sql_in); @@ -1232,7 +1233,8 @@ class fulltext_native extends search_backend { $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' SET word_count = word_count - 1 - WHERE ' . $db->sql_in_set('word_id', $title_word_ids); + WHERE ' . $db->sql_in_set('word_id', $title_word_ids) . ' + AND word_count > 0'; $db->sql_query($sql); } @@ -1240,7 +1242,8 @@ class fulltext_native extends search_backend { $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' SET word_count = word_count - 1 - WHERE ' . $db->sql_in_set('word_id', $message_word_ids); + WHERE ' . $db->sql_in_set('word_id', $message_word_ids) . ' + AND word_count > 0'; $db->sql_query($sql); }