Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceDatabasePopulator does not handle comments properly when ignoring failures [SPR-6345] #11011

Closed
spring-projects-issues opened this issue Nov 13, 2009 · 1 comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Jaro Kuruc opened SPR-6345 and commented

Hi

I have a schema sql script which starts with a comment, followed by DROP and CREATE statements. I have configured DatabasePopulator to ignore DROP failures when initializing datasource.

In case of failure, ResourceDatabasePopulator tests on line 154 if statement starts with 'drop' substring and then based on ignoreFailedDrops setting ignores or rethrows the original SQLException. Because of the comment in my script, first statement starts with '-- ' substring, which then causes that the drop failure is not ignored as intended. The DatabasePopulator implementation should be fixed to handle comments better.

Thanks.


Affects: 3.0 RC2

Referenced from: commits 534f8a4

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

Fixed by stripping lines starting with "--" from the script before executing.

@spring-projects-issues spring-projects-issues added type: bug A general bug in: data Issues in data modules (jdbc, orm, oxm, tx) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 RC3 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant