From 93a2407f6549a0236741973c1fdc980539ce6c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20A=2E=20Ruszczy=C5=84ski?= Date: Tue, 2 Mar 2010 20:36:26 +0100 Subject: [PATCH] Bug #54945 again: MySQL 4 does not support aggregation in ORDER BY. Moved the MIN(smiley_order) to the SELECT column list now, so it can be used for sorting on MySQL 4, but also still works on MSSQL, which the bug was originally about. --- phpBB/includes/functions_posting.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 49ea382411..21c5fe7aca 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -85,10 +85,10 @@ function generate_smilies($mode, $forum_id) if ($mode == 'window') { - $sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height + $sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height, MIN(smiley_order) AS min_smiley_order FROM ' . SMILIES_TABLE . ' GROUP BY smiley_url, smiley_width, smiley_height - ORDER BY MIN(smiley_order)'; + ORDER BY min_smiley_order'; $result = $db->sql_query_limit($sql, $config['smilies_per_page'], $start, 3600); } else