diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-05-14 17:26:02 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-05-14 17:26:02 +0000 |
commit | 3a02ee64b2fa106bb4d7559b6a6836acc3f9a358 (patch) | |
tree | b69d81381c53fdb81f532b46a80b8c670706c3f6 | |
parent | e5ecab0797327b4109d461b99e66b019f6fe50fe (diff) | |
download | brdo-3a02ee64b2fa106bb4d7559b6a6836acc3f9a358.tar.gz brdo-3a02ee64b2fa106bb4d7559b6a6836acc3f9a358.tar.bz2 |
- Patch #22786 by mathias: now that db_affected_rows() returns the number of rows matched instead of only changed we can get rid of the hacks that worked around this.
-rw-r--r-- | modules/search.module | 6 | ||||
-rw-r--r-- | modules/search/search.module | 6 |
2 files changed, 2 insertions, 10 deletions
diff --git a/modules/search.module b/modules/search.module index bf5eaa880..13fcde6de 100644 --- a/modules/search.module +++ b/modules/search.module @@ -215,11 +215,7 @@ function search_cron() { $total = db_result(db_query("SELECT SUM(score) FROM {search_index} WHERE word = '%s'", $word)); db_query("UPDATE {search_total} SET count = %d WHERE word = '%s'", $total, $word); if (!db_affected_rows()) { - // Note: affected rows does not count matching rows that already had the right value! - $exists = db_result(db_query("SELECT COUNT(*) FROM {search_total} WHERE word = '%s'", $word)); - if (!$exists) { - db_query("INSERT INTO {search_total} (word, count) VALUES ('%s', %d)", $word, $total); - } + db_query("INSERT INTO {search_total} (word, count) VALUES ('%s', %d)", $word, $total); } } // Find words that were deleted from search_index, but are still in diff --git a/modules/search/search.module b/modules/search/search.module index bf5eaa880..13fcde6de 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -215,11 +215,7 @@ function search_cron() { $total = db_result(db_query("SELECT SUM(score) FROM {search_index} WHERE word = '%s'", $word)); db_query("UPDATE {search_total} SET count = %d WHERE word = '%s'", $total, $word); if (!db_affected_rows()) { - // Note: affected rows does not count matching rows that already had the right value! - $exists = db_result(db_query("SELECT COUNT(*) FROM {search_total} WHERE word = '%s'", $word)); - if (!$exists) { - db_query("INSERT INTO {search_total} (word, count) VALUES ('%s', %d)", $word, $total); - } + db_query("INSERT INTO {search_total} (word, count) VALUES ('%s', %d)", $word, $total); } } // Find words that were deleted from search_index, but are still in |