Skip to content

SQL Scripts with newline separators no longer work [SPR-11560] #16184

@spring-projects-issues

Description

@spring-projects-issues

Gary Russell opened SPR-11560 and commented

Attempting to execute the following SQL script using a ResourceDatabasePopulator...

CREATE ALIAS IF NOT EXISTS GET_PRIME_NUMBERS FOR "org.springframework.integration.jdbc.storedproc.h2.H2StoredProcedures.getPrimes"
CREATE ALIAS IF NOT EXISTS GET_RANDOM_NUMBER FOR "org.springframework.integration.jdbc.storedproc.h2.H2StoredProcedures.random"

... now results in the following exception:

Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "CREATE ALIAS IF NOT EXISTS GET_PRIME_NUMBERS FOR ""org.springframework.integration.jdbc.storedproc.h2.H2StoredProcedures.getPrimes"" CREATE[*] ALIAS IF NOT EXISTS GET_RANDOM_NUMBER FOR ""org.springframework.integration.jdbc.storedproc.h2.H2StoredProcedures.random"""; SQL statement:
CREATE ALIAS IF NOT EXISTS GET_PRIME_NUMBERS FOR "org.springframework.integration.jdbc.storedproc.h2.H2StoredProcedures.getPrimes" CREATE ALIAS IF NOT EXISTS GET_RANDOM_NUMBER FOR "org.springframework.integration.jdbc.storedproc.h2.H2StoredProcedures.random" [42000-175]

Using ; as the statement separator in the script file resolves this particular case.

This appears to have been caused by the fix to #14165


Affects: 4.0.3

Issue Links:

Referenced from: commits cc0ae3a, bb67cd4, 9230b38

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions