-
Notifications
You must be signed in to change notification settings - Fork 1.9k
check if the next char out of string length #6436
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
check if the next char out of string length #6436
Conversation
…ttps://github.com/fntz/liquibase into fntz-do-not-fail-if-procedure-body-contains-comment-only
…-procedure-body-contains-comment-only
Hi Mike (@fntz), Thank you for submitting a PR to fix #6424! Code changes added look good to me. I would only ask for adding some additional tests for this given issue. I was thinking we could add the changeset example provided in the description of the issue into the Example: <changeSet id="createProcedureWithCommentedBodyTest" author="testUser">
<createProcedure>
/*CREATE PROC... */
</createProcedure>
</changeSet> Thanks, |
Hi Mike (@fntz), Is there anything I can help you with on this PR? Are you ok to perform the suggested changes? If you are ok, I can perform those changes for you. Thanks, |
…-procedure-body-contains-comment-only
…ttps://github.com/fntz/liquibase into fntz-do-not-fail-if-procedure-body-contains-comment-only
…-procedure-body-contains-comment-only
Hi @fntz, I've added a test scenario that contains the Error: DB2IntegrationTest>AbstractIntegrationTest.testUpdateTwice:547 » CommandExecution liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for changeset changelogs/common/common.tests.changelog.xml::createProcedureWithOnlyBlockCommentAsBody::mallod:
Reason: liquibase.exception.DatabaseException: [jcc][10234][10927][4.33.31] SQL passed with no tokens. ERRORCODE=-4462, SQLSTATE=null [Failed SQL: (-4462) ] See more of the execution details here. which means that |
…ific DBs." This reverts commit 1e54204.
…-procedure-body-contains-comment-only
…-procedure-body-contains-comment-only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
Code changes look good to me, this helpful to avoid StringIndexOutOfBoundsException
error happening again. Additionally to the unit test added we have added a test scenario that will be executed as part of our Integration tests. This test helped us to identify there are some DBs (like Oracle, HSQL, etc) that doesn't accept an empty/block of comment for the SQL body, because the given DB executor will try to execute that body, and it will fail because there are no SQL token present on it. We have decided to move forward with it leaving on user judgement that just a block of comment is not what some others DBs expect when creating a procedure.
* check if the next char out of length * use correct string length * Common integration test added for procedure with commented body scenario. * Added dbms property to only run this test against a some specific DBs. * Revert "Added dbms property to only run this test against a some specific DBs." This reverts commit 1e54204. * Added dbms property to only run this test against a some specific DBs. --------- Co-authored-by: Daniel Mallorga <dmallorga@liquibase.com> Co-authored-by: Daniel Mallorga <75833793+MalloD12@users.noreply.github.com>
Impact
Description
Fixes #6424