DdlUtils
  1. DdlUtils
  2. DDLUTILS-62

column DEFAULT - SQL error during create table in ddlToDatabase( to MySQL) using files produced by databaseToDdl(from MSSQL)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0 RC1
    • Labels:
      None
    • Environment:
      Windows 2K
      MSSQL 2000
      JDBC Driver - jtds
      MySQL 5.0
      JDBC driver - MySQL Connector/J - mysql-connector-java-5.0.0-beta

      Description

      • This issue is clone of another issue, but is cloned for highlighting the specific issue around the actual default value
      • Dumped out a database from MSSQL using ddlutils ant task
      • Using these files, attempting creating the equivalent database on MySQL 5.0
      • Getting few errors as below:
        CREATE TABLE `whatever`
        (
        `col1` INTEGER NOT NULL,
        `col2` INTEGER NOT NULL,
        `col3` CHAR(1) DEFAULT '(''some string'')' NULL
        ) failed with You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax ...
      • I changed the col3 line to as follows and then the ddltodatabase works fine
        `col3` CHAR(1) DEFAULT 'some string' NULL
      • I am not too sure why this specific default value is xml encoded in the first place, but in any case, if one indeed had such literal data,
        there should be a way to configure the ddlutils to deal with it (possibly appropriately escape/encode)
      • I could not find info if there were any user configurable settings that can overcome this problem.

        Issue Links

          Activity

          Hide
          Appajee Papolu added a comment -

          I mean I acutally modified the schema.xml file to have the default value appear the above way in the SQL ....
          for example, as below
          <column name="col3" primaryKey="false" required="false" type="CHAR" size="1" default="0" autoIncrement="false"/>

          Show
          Appajee Papolu added a comment - I mean I acutally modified the schema.xml file to have the default value appear the above way in the SQL .... for example, as below <column name="col3" primaryKey="false" required="false" type="CHAR" size="1" default="0" autoIncrement="false"/>
          Hide
          Thomas Dudziak added a comment -

          Could you please attach either the original table's definition SQL, or the schema dumped by DdlUtils?

          Show
          Thomas Dudziak added a comment - Could you please attach either the original table's definition SQL, or the schema dumped by DdlUtils?
          Hide
          Thomas Dudziak added a comment -

          This should be fixed (similar to DDLUTILS-61).

          Show
          Thomas Dudziak added a comment - This should be fixed (similar to DDLUTILS-61 ).

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development