Skip to content

JdbcTestUtils should not interpret comments as a separate statement [SPR-9593] #14227

@spring-projects-issues

Description

@spring-projects-issues

Johannes Odland opened SPR-9593 and commented

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

Affects: 3.1.2

Sub-tasks:

Issue Links:

Referenced from: commits 397d20b, 4aaf014, d8dc4a2

Metadata

Metadata

Assignees

Labels

in: testIssues in the test moduletype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions