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

Do not throw a confusing error if a datatype specified as a changelog parameter is not expanded #2772

Merged
merged 1 commit into from
May 6, 2022

Conversation

nvoxland
Copy link
Contributor

Description

If a user specifies something that looks like a changelog parameter but doesn't match a specified parameter, liquibase simply users it as-is.

However, the DataType.fromDescription function that is used to determine the actual datatype to return cannot correctly handle a datatype that is formatted like a changelog parameter.

This fixes the datatype handling so it handles a datatype that looks like ${ ... } as just a datatype it doesn't understand.

Example Problem Changeset

<createTable tableName="test_table">
    <column name="id" type="${invalid}"/>
</createTable>

Current behavior

Throws an ArrayIndexOutOfBoundsException exception

Fixed behavior

Fails with an error like Syntax error in SQL statement "CREATE TABLE test_table (id ${INVALID } which allows the user to recognize that they did not correctly set the changelog parameter

…g parameters.

It doesn't try to expand them or log anything, just treats them as "unknown" datatypes rather than throwing a confusing exception
@github-actions
Copy link

Unit Test Results

  4 512 files    4 512 suites   39m 1s ⏱️
  4 375 tests   4 161 ✔️    214 💤 0
51 780 runs  46 772 ✔️ 5 008 💤 0

Results for commit aa5bdd8.

@XDelphiGrl
Copy link
Contributor

  • Fix is straightforward and improves user experience.
  • New unit test added.
  • No additional testing necessary.

These changes have no impact on harness or functional tests.

Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@nvoxland nvoxland merged commit 9f56746 into master May 6, 2022
@nvoxland nvoxland deleted the pass-through-unexpanded-datatypes branch May 6, 2022 16:47
@kataggart kataggart added this to the NEXT milestone May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants