Uploaded image for project: 'S2Dao'
  1. S2Dao
  2. DAO-72

SQLコメント中の?があるとjava.lang.ArrayIndexOutOfBoundsExceptionが起こることがある

XMLWordPrintable

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major Major
    • 1.0.41
    • Affects Version/s: 1.0.40
    • Component/s: s2dao
    • None

      再現方法:
      S2Dao 1.0.40に含まれるUnitTestに対して、以下の修正を行なうことにより再現できます。

      修正箇所:
      s2dao\s2-dao\src\test\resources\org\seasar\dao\impl\DefaultTest$DefaultTableDao_insertBySql.sql

      % diff u DefaultTest$DefaultTableDao_insertBySql.sql DefaultTest$DefaultTableDao_insertBySql.sql
      — DefaultTest$DefaultTableDao_insertBySql.sql- Wed Nov 01 01:17:00 2006

      +++ DefaultTest$DefaultTableDao_insertBySql.sql Wed Feb 21 11:50:48 2007
      @@ -3,7 +3,9 @@
      /IF dto.bbb != null/BBB,/END/
      VERSION_NO
      ) VALUES (
      + /* パート */
      /IF dto.aaa != null//dto.aaa/null,/END/
      /IF dto.bbb != null//dto.bbb/null,/END/
      0
      + /* コメント中の? */
      )

      実行例:
      % cd \s2dao\s2-dao\
      % mvn test -Dtest=DefaultTest
      ...
      % more target\surefire-reports\org.seasar.dao.impl.DefaultTest.txt
      -------------------------------------------------------------------------------
      Test set: org.seasar.dao.impl.DefaultTest
      -------------------------------------------------------------------------------
      Tests run: 11, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 4.517 sec <<< FAILURE!
      testInsertByManualSqlTx(org.seasar.dao.impl.DefaultTest) Time elapsed: 0.187 sec <<< ERROR!
      java.lang.ArrayIndexOutOfBoundsException: 1
      at org.seasar.extension.jdbc.impl.BasicHandler.getCompleteSql(BasicHandler.java:148)
      at org.seasar.extension.jdbc.impl.BasicUpdateHandler.execute(BasicUpdateHandler.java:62)
      ...

            Assignee:
            azusa azusa
            Reporter:
            ttanaka T.Tanaka
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: