Skip to content

Commit f547f42

Browse files
committed
Fix error 1055 in MySQL 5.7 (sql_mode=only_full_group_by)
1 parent c4e7e7e commit f547f42

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

qa-include/db/hotness.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function qa_db_hotness_update($firstpostid, $lastpostid = null, $viewincrement =
6161
if (!isset($lastpostid))
6262
$lastpostid = $firstpostid;
6363

64-
$query = "UPDATE ^posts AS x, (SELECT parents.postid, parents.created AS qcreated, COALESCE(MAX(children.created), parents.created) as acreated, children.acount, parents.netvotes, parents.views FROM ^posts AS parents LEFT JOIN ^posts AS children ON parents.postid=children.parentid AND children.type='A' WHERE parents.postid BETWEEN # AND # GROUP BY postid) AS a SET x.hotness=(" .
64+
$query = "UPDATE ^posts AS x, (SELECT parents.postid, parents.created AS qcreated, COALESCE(MAX(children.created), parents.created) as acreated, COUNT(children.postid) AS acount, parents.netvotes, parents.views FROM ^posts AS parents LEFT JOIN ^posts AS children ON parents.postid=children.parentid AND children.type='A' WHERE parents.postid BETWEEN # AND # GROUP BY postid) AS a SET x.hotness=(" .
6565
'((TO_DAYS(a.qcreated)-734138)*86400.0+TIME_TO_SEC(a.qcreated))*# + ' . // zero-point is Jan 1, 2010
6666
'((TO_DAYS(a.acreated)-734138)*86400.0+TIME_TO_SEC(a.acreated))*# + ' .
6767
'(a.acount+0.0)*# + ' .

0 commit comments

Comments
 (0)