Uploaded image for project: 'DdlUtils'
  1. DdlUtils
  2. DDLUTILS-193

Empty string default values not written to generated XML

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.1
    • None

    Description

      As per the problem reported by Satish Yellanki on the user mailing list, a table defined in MySql as:

      CREATE TABLE mytable (
      column1 int(10) unsigned NOT NULL default '0',
      column2 varchar(45) NOT NULL default '',
      column3 varchar(7) NOT NULL default '',
      column4 tinyint(3) unsigned default NULL,
      column5 varchar(45) default NULL,
      PRIMARY KEY (column1)
      )

      will result in this XML:

      <?xml version='1.0' encoding='UTF-8'?>
      <database name="unnamed">
      <table name="mytable" description="">
      <column name="column1" primaryKey="true" required="true" type="INTEGER" size="10" default="0" autoIncrement="false" />
      <column name="column2" primaryKey="false" required="true" type="VARCHAR" size="45" autoIncrement="false" />
      <column name="column3" primaryKey="false" required="true" type="VARCHAR" size="7" autoIncrement="false" />
      <column name="column4" primaryKey="false" required="false" type="TINYINT" size="3" autoIncrement="false" />
      <column name="column5" primaryKey="false" required="false" type="VARCHAR" size="45" autoIncrement="false" />
      </table>
      </database>

      which is missing the default attributes for column2 and c olumn3. Instead the XML should look like this:

      <?xml version='1.0' encoding='UTF-8'?>
      <database name="unnamed">
      <table name="mytable" description="">
      <column name="column1" primaryKey="true" required="true" type="INTEGER" size="10" default="0" autoIncrement="false" />
      <column name="column2" primaryKey="false" required="true" type="VARCHAR" size="45" default="" autoIncrement="false" />
      <column name="column3" primaryKey="false" required="true" type="VARCHAR" size="7" default="" autoIncrement="false" />
      <column name="column4" primaryKey="false" required="false" type="TINYINT" size="3" autoIncrement="false" />
      <column name="column5" primaryKey="false" required="false" type="VARCHAR" size="45" autoIncrement="false" />
      </table>
      </database>

      Attachments

        Activity

          People

            tomdz Thomas Dudziak
            tomdz Thomas Dudziak
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: