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

createProcedure with multiple comma separated dbms triggers validation-check #5266

Closed
2 tasks done
nsd0jlohmann opened this issue Nov 21, 2023 · 0 comments · Fixed by #5267
Closed
2 tasks done

createProcedure with multiple comma separated dbms triggers validation-check #5266

nsd0jlohmann opened this issue Nov 21, 2023 · 0 comments · Fixed by #5267

Comments

@nsd0jlohmann
Copy link

Search first

  • I searched and no similar issues were found

Description

According to https://docs.liquibase.com/change-types/create-procedure.html the dbms-attribute in of a createProcedure Change Type should allow comma separated values. It seems, that this is not implemented as such.

In version 4.7 this was working as expected.

Steps To Reproduce

Create a changeset with a createProcedure-change, which contains dmbs="mysql,mariadb".

Expected/Desired Behavior

The changeset should not trigger a validation-check.

Liquibase Version

tested at 4.25.0, but probably all versions 4.8 - 4.25

Database Vendor & Version

mysql,mariadb

Liquibase Integration

spring boot

Liquibase Extensions

No response

OS and/or Infrastructure Type/Provider

ubuntu

Additional Context

I had a look at the code.

CreateProcedureChange.validate(database) calls DatabaseList.validateDefinitions(String definition, vErrors) with the string provided in the dbms-attribute. It seams, that the valdiateDefinitions-method is supposed to be called with an already split dbms-string.

I want to fix this issue by moving the implementation of DatabaseList.validateDefinitions(String definition, vErrors) in a private method DatabaseList.validateDefinition(String definition, vErrors) (singular). The public DatabaseList.validateDefinitions would then call toDbmsSet(String definition) to split the given definition. Then I can call DatabaseList.validateDefinitions(Collection<String> definitions, vErrors), which in turn calls the private `DatabaseList.validateDefinition(String definition, vErrors)``.

I have prepared a fix and will create a pull request.

Are you willing to submit a PR?

  • I'm willing to submit a PR (Thank you!)
jclohmann added a commit to jclohmann/liquibase that referenced this issue Nov 21, 2023
@kevin-atx kevin-atx changed the title createProdecure with multiple comma separated dbms triggers validation-check createProcedure with multiple comma separated dbms triggers validation-check Nov 22, 2023
rberezen pushed a commit that referenced this issue Dec 5, 2023
filipelautert pushed a commit that referenced this issue Dec 20, 2023
…triggers validation-check (#5267)

* fix #5266: comma separated dbms-attribute for createProcedure-change triggers validation-check

* Null check added.

* migrate DatabaseListTest to groovy

---------

Co-authored-by: Daniel Mallorga <dmallorga@liquibase.com>
Co-authored-by: rberezen <ruslan.berezenskyi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
2 participants