-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
Milestone
Description
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 scriptAffects: 3.1.2
Sub-tasks:
- Backport "JdbcTestUtils should not interpret comments as a separate statement" [SPR-9903] #14536 Backport "JdbcTestUtils should not interpret comments as a separate statement"
Issue Links:
- Deprecate SimpleJdbcTestUtils in favor of JdbcTestUtils [SPR-9235] #13873 Deprecate SimpleJdbcTestUtils in favor of JdbcTestUtils
- Support comments within SQL statements in JdbcTestUtils [SPR-9982] #14616 Support comments within SQL statements in JdbcTestUtils
- Improve comment handling in ResourceDatabasePopulator [SPR-9261] #13899 Improve comment handling in ResourceDatabasePopulator ("supersedes")