Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-34372

Column alias in get_backup_status_array query causes cron to fail

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2.4, 2.3, 2.4
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Backup
    • Labels:
    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide

      Test pre-requisites

      • One course at least
      • Automated backups enabled
      • To be tested on all major DB engines

      Test steps

      1. Run the cli `php admin/cli/automated_backups.php`
      2. Make sure no errors/exception appear during the process
      3. Make sure the admin receive the email at the end
      Show
      Test pre-requisites One course at least Automated backups enabled To be tested on all major DB engines Test steps Run the cli `php admin/cli/automated_backups.php` Make sure no errors/exception appear during the process Make sure the admin receive the email at the end
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE

      Description

      Cron running on Moodle 2.3 finishes with this error:

      Backing up Careers...complete - next execution: Wednesday, 18 July 2012, 2:00 AM
      Backing up Data Analysis...complete - next execution: Wednesday, 18 July 2012, 2:00 AM
      Backing up 12 Legal Studies...complete - next execution: Wednesday, 18 July 2012, 2:00 AM
      Sending email to admin
      !!! Error reading from database !!!

      Postgres version is:
      PostgreSQL 8.3.14 on x86_64-unknown-linux-gnu, compiled by GCC gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291]

      It looks to be because the query in get_backup_status_array() is missing an "AS" for aliasing one of the columns.

      PostgreSQL 8.3 requires the "AS" to alias a column. See here http://www.postgresql.org/docs/8.3/static/sql-select.html

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Sep/12