MDL-34840 fix fatal pg error during upgrade

This is a regression caused by MDL-30515
This commit is contained in:
Petr Škoda
2012-08-11 17:49:11 +02:00
parent c36de79f5c
commit 76bdfc1d79
+1 -1
View File
@@ -164,7 +164,7 @@ function xmldb_main_upgrade($oldversion) {
$index = new xmldb_index('contextid-lowerboundary-letter', XMLDB_INDEX_UNIQUE, array('contextid', 'lowerboundary', 'letter'));
// MDL-30515 Removing duplicate entries before adding the unique index
$sql = "SELECT MAX(id) as newestid, contextid, lowerboundary, letter, COUNT('x') count
$sql = "SELECT MAX(id) as newestid, contextid, lowerboundary, letter, COUNT('x') AS dcount
FROM {grade_letters}
GROUP BY contextid, lowerboundary, letter
HAVING COUNT('x') > 1";