MDL-34372: Fix query in backup_cron_helper so it works on Postgres 8.3
authorNathan Mares <nathan@catalyst-au.net>
Tue, 17 Jul 2012 09:37:06 +0000 (19:37 +1000)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 20 Aug 2012 11:28:37 +0000 (13:28 +0200)
Amended by stronk7@moodle.org to use uppercase SQL keywords.

backup/util/helper/backup_cron_helper.class.php

index 9715a5d..4df4360 100644 (file)
@@ -255,7 +255,7 @@ abstract class backup_cron_automated_helper {
             self::BACKUP_STATUS_SKIPPED => 0,
         );
 
-        $statuses = $DB->get_records_sql('SELECT DISTINCT bc.laststatus, COUNT(bc.courseid) statuscount FROM {backup_courses} bc GROUP BY bc.laststatus');
+        $statuses = $DB->get_records_sql('SELECT DISTINCT bc.laststatus, COUNT(bc.courseid) AS statuscount FROM {backup_courses} bc GROUP BY bc.laststatus');
 
         foreach ($statuses as $status) {
             if (empty($status->statuscount)) {