[Slashdotjp-dev 1534] [1065] fix previous commit

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 3月 11日 (水) 17:49:13 JST


Revision: 1065
          http://svn.sourceforge.jp/view?root=slashdotjp&view=rev&rev=1065
Author:   tach
Date:     2009-03-11 17:49:13 +0900 (Wed, 11 Mar 2009)

Log Message:
-----------
fix previous commit

Modified Paths:
--------------
    slashjp/trunk/Slash/DB/MySQL/MySQL.pm


-------------- next part --------------
Modified: slashjp/trunk/Slash/DB/MySQL/MySQL.pm
===================================================================
--- slashjp/trunk/Slash/DB/MySQL/MySQL.pm	2009-03-11 08:45:43 UTC (rev 1064)
+++ slashjp/trunk/Slash/DB/MySQL/MySQL.pm	2009-03-11 08:49:13 UTC (rev 1065)
@@ -5908,6 +5908,7 @@
 	my $topic   = $options->{topic}   || '';
 	my $section = $options->{section} || '';
 	my $tables = 'stories JOIN story_text USING (stoid)';
+	my $groupby = '';
 	my $where;
 	my $name  = 'story_by_time';
 	_genericCacheRefresh($self, $name, $constants->{story_expire} || 600);
@@ -5931,6 +5932,7 @@
 	my $mp_tid = $constants->{mainpage_nexus_tid} || 1;
 	if (!$section && !$topic && $user->{sectioncollapse}) {
 		$tables .= ' JOIN story_topics_rendered USING (stoid)';
+		$groupby .= 'GROUP BY stories.stoid';
 		my $nexuses = $self->getNexusChildrenTids($mp_tid);
 		my $nexus_clause = join ',', @$nexuses, $mp_tid;
 		$where .= " AND story_topics_rendered.tid IN ($nexus_clause)";
@@ -5947,9 +5949,11 @@
 			if ($nexus_clause);
 		if ($user->{story_never_nexus} || $nexus_clause) {
 			$tables .= ' JOIN story_topics_rendered USING (stoid)';
+			$groupby .= 'GROUP BY stories.stoid';
 		}
 	} else {
 		$tables .= ' JOIN story_topics_rendered USING (stoid)';
+		$groupby .= 'GROUP BY stories.stoid';
 		$where .= " AND story_topics_rendered.tid = $mp_tid";
 		$key .= '|=';
 	}
@@ -5991,8 +5995,7 @@
 		 AND time <= $now
 		 AND in_trash = 'no'
 		 $where",
-
-		"GROUP BY stories.stoid ORDER BY time $order LIMIT $limit"
+		"$groupby ORDER BY time $order LIMIT $limit"
 	);
 	# needs to be defined as empty
 	$cache->{$key} = $returnable || '' if $key;



Slashdotjp-dev メーリングリストの案内
Back to archive index