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

mysql columns of type "double" not handled correctly in mysqli_native_moodle_database.php

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.0.3
    • Database SQL/XMLDB
    • MySQL version 5.1.45
    • MySQL
    • MOODLE_20_STABLE

      Found that the following four columns are incorrectly identified as having inconsistent default values in the XMLDB editor:

      lesson_grades.grade
      scorm.maxgrade
      workshop_elements_old.stddev
      mdl_workshop_assessments_old.grade

      These also happen to be the only columns of type "double" in mysql. And, they are the only columns defined in the XMLDB XML as type "float" with no DECIMALS attribute set. (Try: find -name "install.xml" | xargs -i grep -H 'TYPE="float"' {})

      Things appear to go wrong in get_columns in lib/dml/mysqli_native_moodle_database.php at this line:

      } else if (preg_match('/(decimal|double|float)((\d+),(\d+))/i', $rawcolumn->type, $matches)) {

      which assumes that the double will include size information. In these cases, at least, it does not, and so the column info does not get the attributes populated.

      I don't know if this has cause problems in areas other than the XMLDB editor default values check.

            Unassigned Unassigned
            colin Colin Campbell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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