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
If a createProcedure tag contains only block comment as body, then the execution fails with exception:
java.lang.StringIndexOutOfBoundsException: String index out of range: 18
at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47)
at java.base/java.lang.String.charAt(String.java:693)
at liquibase.util.StringUtil.getLastBlockComment(StringUtil.java:944)
at liquibase.util.StringUtil.stripSqlCommentsAndWhitespacesFromTheEnd(StringUtil.java:1019)
at liquibase.sqlgenerator.core.CreateProcedureGenerator.removeTrailingDelimiter(CreateProcedureGenerator.java:123)
at liquibase.sqlgenerator.core.CreateProcedureGenerator.generateSql(CreateProcedureGenerator.java:87)
at liquibase.sqlgenerator.core.CreateProcedureGenerator.generateSql(CreateProcedureGenerator.java:27)
at liquibase.sqlgenerator.SqlGeneratorChain.generateSql(SqlGeneratorChain.java:32)
at liquibase.sqlgenerator.SqlGeneratorFactory.generateSql(SqlGeneratorFactory.java:224)
at liquibase.util.SqlUtil.getSqlString(SqlUtil.java:360)
at liquibase.changelog.ChangeSet.lambda$addSqlMdc$3(ChangeSet.java:1617)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at liquibase.changelog.ChangeSet.addSqlMdc(ChangeSet.java:1618)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:765)
The error is clear: in liquibase.util.StringUtil.getLastBlockComment(StringUtil.java:944)
at the statement char e = reversedString.charAt(i + 1); not checked if the index i has reached the end of the string before advanced +1
Steps To Reproduce
Execute the update command on the following script:
Search first
Description
If a createProcedure tag contains only block comment as body, then the execution fails with exception:
The error is clear: in
liquibase.util.StringUtil.getLastBlockComment(StringUtil.java:944)
at the statement
char e = reversedString.charAt(i + 1);
not checked if the indexi
has reached the end of the string before advanced +1Steps To Reproduce
Execute the
update
command on the following script:Expected/Desired Behavior
It should just complain about empty body:
Must specify either 'path' or a nested procedure text in createProcedure
Liquibase Version
4.28.0, 4.29.0
Database Vendor & Version
Liquibase Integration
all
Liquibase Extensions
OS and/or Infrastructure Type/Provider
all
Additional Context
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: