From af738dbc2a48713f59779410955282aa5760b741 Mon Sep 17 00:00:00 2001 From: David M Date: Fri, 4 Jan 2008 18:35:49 +0000 Subject: Ch-ch-ch-changes - Made us more DB independent by making many queries capability based instead of DB specific - Finished PHP5ifying of the acm_file class, now with some (hopefully) enhancements to its performance - Sped up viewforum considerably (also goes towards mcp_forum) I really hope I didn't explode CVS... git-svn-id: file:///svn/phpbb/trunk@8301 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/search/fulltext_native.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/search/fulltext_native.php') diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 89689151fe..788af4b002 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -864,14 +864,14 @@ class fulltext_native extends search_backend } else { - if ($db->sql_layer == 'sqlite') + if ($db->count_distinct) { - $sql = 'SELECT COUNT(topic_id) as total_results - FROM (SELECT DISTINCT t.topic_id'; + $sql = 'SELECT COUNT(DISTINCT t.topic_id) as total_results'; } else { - $sql = 'SELECT COUNT(DISTINCT t.topic_id) as total_results'; + $sql = 'SELECT COUNT(topic_id) as total_results + FROM (SELECT DISTINCT t.topic_id'; } $sql .= ' FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p @@ -881,7 +881,7 @@ class fulltext_native extends search_backend $m_approve_fid_sql $sql_fora AND t.topic_id = p.topic_id - $sql_time" . (($db->sql_layer == 'sqlite') ? ')' : ''); + $sql_time" . (($db->count_distinct) ? '' : ')'); } $result = $db->sql_query($sql); -- cgit v1.2.1