ScriptUtils fails to split statements of a SQL script [SPR-16927] #21466
Labels
in: data
Issues in data modules (jdbc, orm, oxm, tx)
status: invalid
An issue that we don't feel is valid
Steffen Harbich opened SPR-16927 and commented
Consider the following script (quartz
tables_mysql_innodb.sql
):It is executed using QuartzAutoConfiguration's QuartzDataSourceInitializer for mysql. The
ScriptUtils
class will finally parse this script as 2 statements in line 464 (https://github.com/spring-projects/spring-framework/blob/master/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/ScriptUtils.java#L464) which is wrong I think. Executing those statements results in a syntax exception because only one statement can be executed at a time:If I remove the comments from the script then everything works fine as expected. I suspect that parsing of apostrophe in comment doesn't work as intended.
Affects: 5.0.6
Reference URL: https://stackoverflow.com/questions/50793308
The text was updated successfully, but these errors were encountered: