Moodle
  1. Moodle
  2. MDL-27634

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

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0.3
    • Fix Version/s: STABLE backlog
    • Component/s: Database SQL/XMLDB
    • Labels:
    • Environment:
      MySQL version 5.1.45
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      17298

      Description

      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.

        Activity

        Hide
        Eloy Lafuente (stronk7) added a comment -

        This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.

        For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

        Show
        Eloy Lafuente (stronk7) added a comment - This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

          People

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

            Dates

            • Created:
              Updated: