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

Unable to sort by a date field at PostgreSQL - CAST() problem

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.3, 1.9
    • Fix Version/s: 1.8.6, 1.9.1
    • Labels:
      None
    • Environment:
      Reported at PostgreSQL 8.0
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      See mod/data/field/date/field.class.php :

      function get_sort_sql($fieldname) {
      return 'CAST('.$fieldname.' AS unsigned)';
      }

      This causes problem at PostgreSQL as there is no such type "unsigned": ERROR: type "unsigned" does not exist. Note that CAST() is SQL standard but the target datatype has to be known for the SQL environement.

      No records are displayed.

      Assigning this to myself as a part of my Bugathon run.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/May/08