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

xmldb generates is adding a "default =''" clause to the column when not specified in xml definition

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.8.1
    • Fix Version/s: None
    • Component/s: Installation
    • Labels:
      None
    • Environment:
      MySQL
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_18_STABLE

      Description

      When installing a module that had the following in the xmldb install.xml field definition:

      <FIELD NAME="type" TYPE="char" LENGTH="16" NOTNULL="true" SEQUENCE="false" ENUM="true" ENUMVALUES="'qe', 'qb'" COMMENT="The type of this server - question engine or question bank." PREVIOUS="engineid" NEXT="url"/>

      This generated an error when installing on MySQL, error message - default not a valid value for field type.

      Looking at the SQL xmldb lib had produced, it had added default='' to the SQL statement. I got around this problem by specifying a (non null and non-empty/blank) default value in the install.xml - but there could be cases when you don't want a default specified in the xmldb definition - in which case xmldb lib shouldn't automatically add default=''

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: