-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fixes snapshot of case-sensitive views #3329
Fixes snapshot of case-sensitive views #3329
Conversation
…cated when it is created with objectQuotingStrategy="QUOTE_ALL_OBJECTS" and evaluated without
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.
Code review and test results:
Things to be aware of:
- I was wondering if the ViewSnapshotGenerator was the place to put the change, since there are times users specify the view name and may be specifying with the wrong case. But the only spot that does that is the viewExists precondition and that code already corrects the case before passing it to this function. So the change is good and is best-handling it at the lowest spot.
- Test exposes a separate potential issue in that generated changests don't include any object quoting. Unsure if that's a feature or a bug, and nobody has ever asked about it that I remember so I won't worry about it now.
- Includes new integration test in h2 that tests this specifically for case sensitivity. It uses "tableExists" since the issue used that, but the root cause is view snapshot since h2 ends up snapshotting views as part of table snapshot.
Things to worry about:
- Nothing, my one worry was handled
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.
This PR fixes an H2 bug caused by differences in the Liquibase setting for OBJECT_QUOTING_STRATEGY
during object creation and the default OBJECT_QUOTING_STRATEGY
when preconditions are evaluated.
- New integration test added.
- Functional test failure unrelated to fix.
- No additional testing required.
APPROVED
Impact
Description
When a view is created using objectQuotingStrategy="QUOTE_ALL_OBJECTS" , the name is saved as defined (ie: "MyView" ) - otherwise it is all upcase (MYVIEW) . As the default strategy for h2 is LEGACY, it fails on subsequent changesets unless QUOTE_ALL_OBJECTS is specified (tested on H2 and postgres: H2 failed, postgresql not).
It fails using the "update" command - if we execute the command "snapshot" , the strategy is already set by default to QUOTE_ALL_OBJECTS so it works.
This PR changes the strategy to QUOTE_ALL_OBJECTS, snapshots the views and then sets it back to what it was before (as it is done in some others parts of the code).
Things to be aware of
Things to worry about
Additional Context