summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-04 06:53:48 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-04 06:53:48 +0000
commit4bfbde89e72ac2a386d0647669fdd050207fe371 (patch)
tree06f1e085db78e37bcd44153e8b646040eac44927
parentbc37b6dc0ede6ae3f6ef26cf06a006ab92c4b7c3 (diff)
downloadbrdo-4bfbde89e72ac2a386d0647669fdd050207fe371.tar.gz
brdo-4bfbde89e72ac2a386d0647669fdd050207fe371.tar.bz2
#396388 by andypost: Fix syntax of comment order query for pgsql.
-rw-r--r--modules/comment/comment.module4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 526525601..de26cb31a 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -423,11 +423,11 @@ function comment_new_page_count($num_comments, $new_replies, $node) {
else {
// Threaded comments.
// Find the first thread with a new comment.
- $result = db_query_range('(SELECT thread
+ $result = db_query_range('SELECT thread FROM (SELECT thread
FROM {comment}
WHERE nid = :nid
AND status = 0
- ORDER BY timestamp DESC)
+ ORDER BY timestamp DESC) AS thread
ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1))', array(':nid' => $node->nid), 0, $new_replies)->fetchField();
$thread = substr($result, 0, -1);
$count = db_query('SELECT COUNT(*) FROM {comment} WHERE nid = :nid AND status = 0 AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < :thread', array(