Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv783
Modified Files:
serendipity_functions.inc.php
Log Message:
Fixed the comment notification query for postgresql
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -d -r1.157 -r1.158
--- serendipity_functions.inc.php 26 Sep 2003 18:39:20 -0000 1.157
+++ serendipity_functions.inc.php 30 Sep 2003 01:24:59 -0000 1.158
@@ -1009,12 +1009,17 @@
$entryURI = serendipity_archiveURL($entry_id, $title);
$subject = '[' . $serendipity['blogTitle'] . '] ' . sprintf(NEW_COMMENT_TO_SUBSCRIBED_ENTRY, $title);
- $sql = "SELECT author, email, type
+ if (strtolower($serendipity['dbType']) == 'postgres') {
+ $pgsql_insert = "DISTINCT ON (email)";
+ } else {
+ $mysql_insert = "GROUP BY email";
+ }
+
+ $sql = "SELECT $pgsql_insert author, email, type
FROM {$serendipity['dbPrefix']}comments
WHERE entry_id = $entry_id
AND email <> '$posterMail'
- AND subscribed = 'true'
- GROUP BY email";
+ AND subscribed = 'true' $mysql_insert";
$subscribers = serendipity_db_query($sql);
if (!is_array($subscribers)) {
|