You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following lines from an SQL script worked with the EmbeddedDatabaseBuilder until I updated to the latest nightly snapshot (org.springframework.jdbc-3.0.4.BUILD-20100810.004442-53).
Execution of this script results in the following stacktrace:
org.springframework.dao.DataAccessResourceFailureException: Failed to populate database; nested exception is java.sql.SQLException: Unexpected token INTOUSERS, requires INTO in statement [INSERT INTOusers]
at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory.populateDatabase(EmbeddedDatabaseFactory.java:158)
at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory.initDatabase(EmbeddedDatabaseFactory.java:138)
at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory.getDatabase(EmbeddedDatabaseFactory.java:114)
at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder.build(EmbeddedDatabaseBuilder.java:112)
Removing the newline between INTO and users (as in the following script) works. Thus, recent changes (from 3.0.3 - 3.0.4) now swallow \n in SQL scripts, effectively concatenating adjacent lines.
Interesting, as you may have noticed, the last commit on that class is Aug 7th (your nightly is Aug 8th), and Jürgen's comment is that he was 'fixing an accidental regression with respect to newlines'.
Sam Brannen opened SPR-7449 and commented
Status Quo
The following lines from an SQL script worked with the
EmbeddedDatabaseBuilder
until I updated to the latest nightly snapshot (org.springframework.jdbc-3.0.4.BUILD-20100810.004442-53
).Execution of this script results in the following stacktrace:
Removing the newline between
INTO
andusers
(as in the following script) works. Thus, recent changes (from 3.0.3 - 3.0.4) now swallow\n
in SQL scripts, effectively concatenating adjacent lines.Proposed Solution
ResourceDatabasePopulator
should be modified to properly interpret empty lines in contrast to simply swallowing all\n
characters.Affects: 3.0.4
Referenced from: commits 1503a13, e3400f7
The text was updated successfully, but these errors were encountered: