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

SQL Anywhere: Recompile all views after last change of update #4577

Merged
merged 7 commits into from
Nov 6, 2023

Conversation

mkarg
Copy link
Contributor

@mkarg mkarg commented Jul 31, 2023

Impact

Fixes #4575

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

The solution for #4575 simply is to execute the command sa_recompile_views(1) (see SAP SQL Anywhere Manual) once after the very last change was executed by update, which is exactly the same command that the original native tools from SAP execute to resolve this situation. This command never induces any risk, so unconditional execution is no problem in any case (which is why SAP's native tools do execute it unconditionaly).

Things to be aware of

To make the code a little cleaner I extended the Database interface by a new default method, i. e. it implies no harm to existing code, but it opens the possibility for all RDBMS to execute some useful code in similar situations.

Things to worry about

Despite the causeless warning in the SAP manual, as this is exactly the original solution applied by the original native SAP tools, there is absolutely nothing to worry about.

Additional Context

N/A

@mkarg mkarg marked this pull request as ready for review July 31, 2023 11:28
@mkarg mkarg requested a review from filipelautert as a code owner July 31, 2023 11:28
@MalloD12 MalloD12 self-assigned this Aug 4, 2023
@MalloD12 MalloD12 self-requested a review August 4, 2023 13:19
Copy link
Collaborator

@MalloD12 MalloD12 left a comment

Choose a reason for hiding this comment

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

Approved.

Code changes looks good to me. Change made on update logic does not have any impact as this is only doing something for SybaseASADatabase.

Thank you @mkarg!

@filipelautert filipelautert self-requested a review October 27, 2023 14:12
# Conflicts:
#	liquibase-standard/src/main/java/liquibase/database/Database.java
Signed-off-by: filipe <flautert@liquibase.org>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

50.0% 50.0% Coverage
0.0% 0.0% Duplication

@filipelautert
Copy link
Collaborator

@mkarg I did a small refactoring to use the already existing sql executor method instead of creating a new one - could you confirm if it's fine for you? Then I'll get it merged for next release.

@mkarg
Copy link
Contributor Author

mkarg commented Nov 4, 2023

@mkarg I did a small refactoring to use the already existing sql executor method instead of creating a new one - could you confirm if it's fine for you? Then I'll get it merged for next release.

LGTM. :-)

@filipelautert filipelautert merged commit f47e890 into liquibase:master Nov 6, 2023
10 of 13 checks passed
@filipelautert filipelautert added this to the 1NEXT milestone Nov 6, 2023
@mkarg mkarg deleted the on-end-run-sql branch August 14, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

SQL Anywhere fails to SELECT from view when update modified underlying table
7 participants