DdlUtils
  1. DdlUtils
  2. DDLUTILS-193

Empty string default values not written to generated XML

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Labels:
      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>

        Activity

        Thomas Dudziak created issue -
        Thomas Dudziak made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]

          People

          • Assignee:
            Thomas Dudziak
            Reporter:
            Thomas Dudziak
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development