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

Fix problem with negative defaults under PostgreSQL and associated tests

XMLWordPrintable

    • Any
    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • 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).

      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)

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Sam Hemelryk Sam Hemelryk
            Aparup Banerjee Aparup Banerjee
            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.