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

Fix problem with negative defaults under PostgreSQL and associated tests

    Details

    • Database:
      Any
    • Testing Instructions:
      Hide

      This requires the 5 DBs installed (mysql, postgres, mssql, sqlsrv, oracle) and testing it under 21_STABLE could be enough (patch is 100% the same in 20 and master).

      1) Using PostgreSQL (skip the report against other DBs), go to "Site administration > Development > XMLDB editor > Check defaults and run the report in a brand new site (results may be different if the site is one upgrade from previous versions).
      2) TEST: It returns "Wrong defaults found: 0" (before the patch it was detecting false wrong defaults (failing on negative ones)

      3) Run DB functional tests against the 5 databases.
      4) TEST: No failure / exception related with test_get_columns() happens (ignore any other failure).

      Show
      This requires the 5 DBs installed (mysql, postgres, mssql, sqlsrv, oracle) and testing it under 21_STABLE could be enough (patch is 100% the same in 20 and master). 1) Using PostgreSQL (skip the report against other DBs), go to "Site administration > Development > XMLDB editor > Check defaults and run the report in a brand new site (results may be different if the site is one upgrade from previous versions). 2) TEST: It returns "Wrong defaults found: 0" (before the patch it was detecting false wrong defaults (failing on negative ones) 3) Run DB functional tests against the 5 databases. 4) TEST: No failure / exception related with test_get_columns() happens (ignore any other failure).
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      This was discovered when working on MDL-29566.

      It seems that PostgreSQL, when returning defaults for numerical columns, if the value is negative, it comes enclosed by parenthesis, aka: (-1).

      So this issue will introduce the necessary tests to reveal the problem and then fix it under PostgreSQL (and others if necessary)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Oct/11