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

Column alias in get_backup_status_array query causes cron to fail

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.2.4, 2.3, 2.4
    • 2.2.5, 2.3.2
    • Backup
    • PostgreSQL
    • MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • 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

    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

      Attachments

        Activity

          People

            fred Frédéric Massart
            nmares Nathan Mares
            Dan Poltawski Dan Poltawski
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Dan Poltawski Dan Poltawski
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10/Sep/12