Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-3187

Turnitintool doesn't work with PostgreSQL 8.3 and lower

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 1.9.13
    • Module: Turnitintool
    • None
    • PostgreSQL 8.1
    • PostgreSQL
    • Hide

      lib.php line 1476: 'min(dtstart) AS dtstart'.

      Show
      lib.php line 1476: 'min(dtstart) AS dtstart'.
    • MOODLE_19_STABLE

      When clicking Submission Inbox in turnitintool we got this error:
      "Could not get assignment part data (lib.php | 1477)"
      We managed to get rid of this error by adding "AS" in lib.php line 1476: 'min(dtstart) AS dtstart'.

      Apparently in MySQL "AS" is optional for column aliases, but for PostgreSQL < 8.4, it is mandatory.
      http://sql-info.de/postgresql/postgres-gotchas.html#1_1
      http://www.postgresql.org/docs/8.3/static/sql-select.html
      http://www.postgresql.org/docs/8.4/static/sql-select.html
      http://docs.moodle.org/dev/XMLDB_problems#Table_and_column_aliases_-_the_AS_keyword

      I checked turnitintool's code and found there are many more queries of the same kind.
      For example, in calls to "turnitintool_get_record_select", column aliases are mostly written without using "AS".

      Could you please fix and test this with PostgreSQL 8.3 or lower to make sure turnitintool works with all Moodle-supported databases?
      Thank you.

            paul.dawson Paul Dawson (Inactive)
            schach Heiko Schach
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.