Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-9593

JdbcTestUtils should not interpret comments as a separate statement

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.1.3, 3.2 RC1
    • Component/s: Test
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Overview

      The splitSqlScripts() method in JdbcTestUtils splits scripts at a given delimiter, often ';'. If the script has a trailing comment this will be returned as a separate statement. When executing the statements an exception will be thrown.

      Steps to Reproduce

      If you call SimpleJdbcTestUtils.executeSqlScript() on the following script, the trailing comment will be detected as a separate statement and executed, resulting in a BadSqlGrammarException.

      CREATE SQEUENCE HIBERNATE_SEQUENCE;
      -- End of script
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sbrannen Sam Brannen
                Reporter:
                mrodland Johannes Odland
                Last updater:
                Sam Brannen
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 35 weeks, 1 day ago