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

Incorrect handling of float columns metadata and associated tests

XMLWordPrintable

    • MySQL
    • 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 MySQL (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.

      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 MySQL (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. 3) Run DB functional tests against the 5 databases. 4) TEST: No failure / exception related with test_get_columns() happens (ignore any other failure).

      Playing with other modifications in the XMLDB Editor, I detected that the builtin "Check defaults" report was showing persistently some errors in 4 float columns. And that happened in brand new installed sites and only under MySQL.

      After investigating a bit these was detected:

      • float columns without length & decimal specs (allowed) aren't handled by mysql->get_columns() method. It is currently expecting always the length and decimal specs to exist. So fails badly for float columns not having them.
      • float columns and some bits of decimal columns aren't covered by unit tests.

      So here we go trying to fix both problems.

        1. xmldb_defaults_report.png
          46 kB
          Eloy Lafuente (stronk7)

            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.