Skip to content

Support multi-line SQL comments in ResourceDatabasePopulator and JdbcTestUtils [SPR-9531] #14165

@spring-projects-issues

Description

@spring-projects-issues

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

  1. Extract common functionality related to script parsing from ResourceDatabasePopulator and JdbcTestUtils into a new public component or utility in the org.springframework.jdbc.datasource.init package in the spring-jdbc module.
  2. Support multi-line SQL comments in the component extracted in the previous deliverable.
  3. Make the start and end delimiters for block comments configurable.

Affects: 3.1.1

Issue Links:

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)in: testIssues in the test moduletype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions