diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-11-08 04:55:13 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-11-08 04:55:13 +0000 |
commit | 7aea369db5de39ab1cc19c299dba61524c22d25f (patch) | |
tree | 8d6a2d1658053098fea77ae29e0a91c2f3b1b2c7 /modules | |
parent | 1632855a9f72a01edf9e8fea44b734cdbb0086a7 (diff) | |
download | brdo-7aea369db5de39ab1cc19c299dba61524c22d25f.tar.gz brdo-7aea369db5de39ab1cc19c299dba61524c22d25f.tar.bz2 |
#331719 by chx: Fix search query that had a field aliased to one of its column names, causing problems in certain databases.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/search/search.module | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/search/search.module b/modules/search/search.module index c96dfbfa7..627983476 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -948,7 +948,7 @@ function do_search($keywords, $type, $join1 = '', $where1 = '1 = 1', $arguments1 } // Calculate maximum keyword relevance, to normalize it. - $select = "SELECT SUM(i.score * t.count) AS score FROM {search_index} i $join WHERE $conditions GROUP BY i.type, i.sid HAVING COUNT(*) >= %d ORDER BY score DESC"; + $select = "SELECT SUM(i.score * t.count) AS calculated_score FROM {search_index} i $join WHERE $conditions GROUP BY i.type, i.sid HAVING COUNT(*) >= %d ORDER BY calculated_score DESC"; $arguments = array_merge($arguments1, array($query[4])); $normalize = db_result(db_query_range($select, $arguments, 0, 1)); if (!$normalize) { |