Fix GROUP BY clause in Special:MostLinkedTemplates
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 1 Nov 2011 13:14:59 +0000 (13:14 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 1 Nov 2011 13:14:59 +0000 (13:14 +0000)
This only cause a trouble for Microsoft SQL which require the column to be
referenced by their input name, not the output one (AS alias). Might trigger
on Oracle database.

This is part of bug 31913: 'GROUP BY clauses incorrect in SQL generated
for special pages'

Need backport in REL1_18

RELEASE-NOTES-1.18
includes/specials/SpecialMostlinkedtemplates.php

index 9815df8..ded58d1 100644 (file)
@@ -656,6 +656,8 @@ changes to languages because of Bugzilla reports.
 * (bug 30817) Restored linktrail for kk (Kazakh)
 * (bug 27398) Add $wgExtraGenderNamespaces for configured gendered namespaces
 * (bug 30846) New LanguageOs class
+* (bug 31913) Special:MostLinkedTemplates had an incorrect GROUP BY clause
+  under Microsoft SQL.
 
 === Other changes in 1.18 ===
 * Removed legacy wgAjaxWatch javascript global object, no longer in use.
index ab9e152..406173a 100644 (file)
@@ -68,7 +68,7 @@ class MostlinkedTemplatesPage extends QueryPage {
                                        'tl_title AS title',
                                        'COUNT(*) AS value' ),
                        'conds' => array ( 'tl_namespace' => NS_TEMPLATE ),
-                       'options' => array( 'GROUP BY' => 'namespace, title' )
+                       'options' => array( 'GROUP BY' => 'tl_namespace, tl_title' )
                );
        }