-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)in: testIssues in the test moduleIssues in the test moduletype: enhancementA general enhancementA general enhancement
Milestone
Description
Ian Wright opened SPR-9531 and commented
Overview
When executing SQL scripts using ResourceDatabasePopulator
or JdbcTestUtils
errors may occur if there are block comments in the file. In general multi-line comments using the /* ... */
syntax are not explicitly supported.
Notes
Proper support for standard SQL comments (i.e., any text beginning with two hyphens and extending to the end of the line) was introduced in #14616 and #14708. However, neither ResourceDatabasePopulator
nor JdbcTestUtils
contains explicit support for multi-line SQL comments.
Deliverables
- Extract common functionality related to script parsing from
ResourceDatabasePopulator
andJdbcTestUtils
into a newpublic
component or utility in theorg.springframework.jdbc.datasource.init
package in thespring-jdbc
module. - Support multi-line SQL comments in the component extracted in the previous deliverable.
- Make the start and end delimiters for block comments configurable.
Affects: 3.1.1
Issue Links:
- Support EOF as statement separator in SQL scripts [SPR-11687] #16310 Support EOF as statement separator in SQL scripts ("is depended on by")
- SQL Scripts with newline separators no longer work [SPR-11560] #16184 SQL Scripts with newline separators no longer work
- Support comments within SQL statements in JdbcTestUtils [SPR-9982] #14616 Support comments within SQL statements in JdbcTestUtils
- Support comments within SQL statements in ResourceDatabasePopulator [SPR-10075] #14708 Support comments within SQL statements in ResourceDatabasePopulator
- H2 aliases are not supported in SQL ScriptUtils [SPR-15896] #20450 H2 aliases are not supported in SQL ScriptUtils
- Support custom comment prefix in JdbcTestUtils.executeSqlScript() [SPR-11519] #16144 Support custom comment prefix in JdbcTestUtils.executeSqlScript()
- Introduce SQL script exception hierarchy [SPR-11564] #16188 Introduce SQL script exception hierarchy
Referenced from: commits 01b2f67, 7853e74, 9230b38, cc0ae3a, fbd2546, bb67cd4, 2bfd6dd, e5c1756
2 votes, 10 watchers
Metadata
Metadata
Assignees
Labels
in: dataIssues in data modules (jdbc, orm, oxm, tx)Issues in data modules (jdbc, orm, oxm, tx)in: testIssues in the test moduleIssues in the test moduletype: enhancementA general enhancementA general enhancement