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

Fixed issue with h2 loadUpdateData not correctly handling values with the string " values " in the inserted data #1831

Merged
merged 2 commits into from
Sep 19, 2022

Conversation

tomyy
Copy link
Contributor

@tomyy tomyy commented May 8, 2021

Environment

Liquibase Version: all

Liquibase Integration & Version: all

Liquibase Extension(s) & Version:

Database Vendor & Version: H2

Operating System Type & Version: all

Pull Request Type

Description

(Copied from #1767)

Here is the description with a workaround:
https://forum.liquibase.org/t/cant-insert-the-string-scale-values-mean-without-it-being-changed/5121

Steps To Reproduce

Actual Behavior

Changeset rendered:
-- Changeset db.changelog-master.yaml::1595012255439-41::myarbrou
-- WARNING The following SQL may change each run and therefore is possibly incorrect and/or invalid:
MERGE INTO PUBLIC.usage_agreement_terms (version, text, start_date) VALUES ('v1.0', 'scale KEY(version) values mean', '2021-02-12');

Expected/Desired Behavior

Changeset should be:
-- Changeset db.changelog-master.yaml::1595012255439-41::myarbrou
-- WARNING The following SQL may change each run and therefore is possibly incorrect and/or invalid:
MERGE INTO PUBLIC.usage_agreement_terms (version, text, start_date) KEY(version) VALUES ('v1.0', 'scale values mean', '2021-02-12');

Screenshots (if appropriate)

If applicable, add screenshots to help explain your problem.

Additional Context

Add any other context about the problem here.

Fast Track PR Acceptance Checklist:

Need Help?

Come chat with us on our discord channel

@molivasdat
Copy link
Contributor

Hi @tomyy
Thanks for this PR.
There should be a snapshot build in github actions associated with this PR if the tests succeed.
Here's what happens next:
A member of the Liquibase team will take a look at your contribution and may suggest:

The PR will be prioritized according to our internal development and testing capacity.

We’ll let you know when it’s ready to move to the next step or if any changes are needed.

@molivasdat molivasdat added DBH2 ImpactLow IntegrationAny RiskMedium Changes that require more testing or that affect many different code paths. Severity3 TypeBug labels May 14, 2021
@tomyy
Copy link
Contributor Author

tomyy commented May 16, 2021

How can I trigger a rebuild? The "Build and Test / Java 11" failed because some dependencies could not be resolved, but my code change doesn't change any dependencies...

@nvoxland nvoxland self-requested a review as a code owner August 31, 2022 20:48
@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Aug 31, 2022
Copy link
Contributor

@nvoxland nvoxland left a comment

Choose a reason for hiding this comment

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

Code review and test results:

Things to be aware of:

  • Change fixes regular expression to use the first " values " it finds in a statement as the "values" part of the SQL vs. the last " values " it finds which might be in some of the inserted data.
  • Adds a unit test for a problem "values" statement
  • Only impacts H2

Things to worry about:

  • Nothing

@github-actions
Copy link

Unit Test Results

  4 620 files  ±  0    4 620 suites  ±0   36m 32s ⏱️ + 1m 0s
  4 620 tests +  1    4 405 ✔️ +  1     215 💤 ±0  0 ±0 
54 612 runs  +12  49 592 ✔️ +12  5 020 💤 ±0  0 ±0 

Results for commit 86fa083. ± Comparison against base commit 4f7e725.

@nvoxland nvoxland changed the title fix greedy subexpression in regex Fixed issue with h2 loadUpdateData not correctly handling values with the string " values " in the inserted data Aug 31, 2022
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.

PR fixes and H2 bug caused by having the key word "values" in the data of a loadData changetype.

  • New unit test added to validate the fix.

APPROVED

Note: There were test harness failures for EDB Postgres; these are unrelated to this fix and were due to the EDB environment not loading correctly.

@nvoxland nvoxland merged commit 6ae743e into liquibase:master Sep 19, 2022
@kataggart kataggart added this to the NEXT milestone Sep 20, 2022
@tabbyf00
Copy link

Thanks for your PR submission! We just finished reviewing and merging it into the 4.17.0 release on October 10, 2022. When you get a chance, could you please Star the Liquibase project? The star button is in the upper right corner of the screen.

1 similar comment
@tabbyf00
Copy link

Thanks for your PR submission! We just finished reviewing and merging it into the 4.17.0 release on October 10, 2022. When you get a chance, could you please Star the Liquibase project? The star button is in the upper right corner of the screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocandidate complexityLocal criticalityBuilder DBH2 ImpactLow IntegrationAny RiskMedium Changes that require more testing or that affect many different code paths. SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions Severity3 sprint2022-34 TypeBug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Liquibase loadUpdateData doesn't properly insert H2 column text 'scale values mean'
7 participants