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

[V4.25.0] Regression in SQL execution with endDelimiter and splitStatements #5359

Open
1 of 2 tasks
adamjones0101 opened this issue Dec 12, 2023 · 5 comments · May be fixed by #5704
Open
1 of 2 tasks

[V4.25.0] Regression in SQL execution with endDelimiter and splitStatements #5359

adamjones0101 opened this issue Dec 12, 2023 · 5 comments · May be fixed by #5704
Assignees
Labels

Comments

@adamjones0101
Copy link

Search first

  • I searched and no similar issues were found

Description

In a changeset an sql statement is added. splitStatements= true and endDelimiter = "/"
if there are 2 statements in the sql which have an "/" as the last character then the execution fails with a "missing or invalid option" error, ORA-00922 in Oracle DB

Steps To Reproduce

Include the following in a changeset:

<sql dbms="oracle" endDelimiter="/" splitStatements="true" stripComments="false>
CREATE USER mytestuser1 IDENTIFIED BY "abcde12345" PROFILE DEFAULT ACCOUNT UNLOCK/
GRANT CREATE TABLE TO mytestuser1/

Expected/Desired Behavior

in version 4.9.1 this works correctly but in 4.25.0 it appears that the entire sql is executed as a single statement.

Liquibase Version

4.25.0

Database Vendor & Version

No response

Liquibase Integration

No response

Liquibase Extensions

No response

OS and/or Infrastructure Type/Provider

No response

Additional Context

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR (Thank you!)
@tati-qalified
Copy link
Contributor

Hi @adamjones0101, thank you for reporting this issue.
I was able to verify that it is replicable and it was introduced by Liquibase 4.15.0, possibly with #3118.

I'll be forwarding this to the development team so they can evaluate how to move forward.

Thanks,
Tatiana

@MalloD12 MalloD12 self-assigned this Mar 8, 2024
@MalloD12
Copy link
Contributor

Hi @adamjones0101,

As stated by @tati-qalified this behavior has been updated with #3118, and it is working as designed. For you to make this SQL execute successfully you need to update it in the below way:

<sql dbms="oracle" endDelimiter="/" splitStatements="true" stripComments="false">
CREATE USER mytestuser1 IDENTIFIED BY "abcde123" PROFILE DEFAULT ACCOUNT UNLOCK
/
GRANT CREATE TABLE TO mytestuser1
/
</sql>

There shouldn't be any space either at the beginning or the end of each sentence and / should be in the next line. As specified by @nvoxland, this is to avoid splitting a statement at the wrong spot.

I'll close this issue for now, but if you have any additional feedback or you are keen to propose an enhancement for this you are more than welcome to do it.

Thanks,
Daniel.

@adamjones0101
Copy link
Author

I guess that there's no concern that nearly every liquibase changelog on the planet has been broken.
We are going to have to modify hundreds if not thousands of changesets to accommodate this backward incompatible change.

@MalloD12
Copy link
Contributor

I guess that there's no concern that nearly every liquibase changelog on the planet has been broken. We are going to have to modify hundreds if not thousands of changesets to accommodate this backward incompatible change.

Let me double-check with some other team members if there is any other option to have both cases working (using / delimiter at the end of SQL sentence and having an expression that contains a / on it and it's not used as the end- delimiter). In the meantime, any idea or enhancement proposal is more than welcome.

Thanks,
Daniel.

@adamjones0101
Copy link
Author

adamjones0101 commented Mar 12, 2024 via email

@tati-qalified tati-qalified added this to the Epic: End Delimiters milestone Mar 14, 2024
@MalloD12 MalloD12 reopened this Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Development PR Issues
Development

Successfully merging a pull request may close this issue.

4 participants