Uploaded image for project: 'Unitils'
  1. Unitils
  2. UNI-234

ddl script fails if comment is the last statement

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.2
    • Fix Version/s: None
    • Component/s: dbmaintainer
    • Labels:
      None
    • Environment:
      Windows XP, MySQL

      Description

      If unitils loads a ddl script, the following works:

      create table test(
        testcol123 varchar(30)
      );

      This works too:

      create table test(
        testcol varchar(30)
      );
      /**/

      But this doesn't:

      create table test(
        testcol varchar(30)
      );
      /**/
      --

      This is the exception:
      org.unitils.core.UnitilsException: Last statement in script was not ended correctly. Each statement should end with one of [;]
      at org.unitils.dbmaintainer.script.impl.DefaultScriptParser.getNextStatementImpl(DefaultScriptParser.java:160)
      at org.unitils.dbmaintainer.script.impl.DefaultScriptParser.getNextStatement(DefaultScriptParser.java:93)
      at org.unitils.dbmaintainer.script.impl.DefaultScriptRunner.execute(DefaultScriptRunner.java:59)
      at org.unitils.dbmaintainer.DBMaintainer.executeScripts(DBMaintainer.java:342)
      at org.unitils.dbmaintainer.DBMaintainer.updateDatabase(DBMaintainer.java:303)
      at org.unitils.dbmaintainer.DBMaintainer.updateDatabase(DBMaintainer.java:245)
      at org.unitils.database.DatabaseModule.updateDatabase(DatabaseModule.java:294)
      at org.unitils.database.DatabaseModule.createDataSource(DatabaseModule.java:353)
      at org.unitils.database.DatabaseModule.getDataSourceAndActivateTransactionIfNeeded(DatabaseModule.java:217)
      at org.unitils.dbunit.DbUnitModule.getDefaultDbSupport(DbUnitModule.java:528)
      at org.unitils.dbunit.DbUnitModule.getDataSetFactory(DbUnitModule.java:501)
      at org.unitils.dbunit.DbUnitModule.getDefaultDataSetFactory(DbUnitModule.java:473)
      at org.unitils.dbunit.DbUnitModule.insertDataSet(DbUnitModule.java:196)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              chrish Christian
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: