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: Switching off view definition checks to allow creation of dependent views even if dependency does not yet exist. #4537
Conversation
…of dependent views even if dependency does not yet exist.
@mkarg this one is having a test failure for asany as it is not expecting the set view:
|
…eation of dependent views even if dependency does not yet exist.
@filipelautert Oops, sorry, seems I missed to push one changed file. Uploaded it a minute ago. Good catch, thank you! :-) |
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.
SQL anywhere specific changes.
Fixes #4536
Impact
Description
This PR introduces the exact same solution as SQL Anywhere's native schema-creation tool
dbunload
is using in the same situation: It temporarily switches off the check whether the dependencies found in the view definition already do exist.See https://help.sap.com/docs/SAP_SQL_Anywhere/61ecb3d4d8be4baaa07cc4db0ddb5d0a/813bf68b6ce21014b288ca2a8ab530f9.html. While it says, this option is just for the use within
reload.sql
anddbunload
, the fact that it is documented proofs that SAP is pretty aware of the fact that there is no other solution to the problem, and the solution must be usable outside of thereload.sql
file. In fact,reload.sql
in a nutshell could be seen as the output ofupdate-sql
, so our use is rather valid.Things to be aware of
SQL Anywhere will not complain anymore about any missing dependencies when creating views. Maybe someone wants
update
to fail? OTOH if he wants such a check, such a check would be a new feature forvalidate
. IMHO it is a misuse ofupdate
to rely on its existing bugs, and the original SAP tool does neither provides such a checking feature!Things to worry about
Paraphrasing SAP's documentation, this should not get used uncoditionally with all
CREATE VIEW
, but only with the ones created bygenerateChangelog
. So a 1:1 copy of SAP's native solution would not be to enable that option inupdate
, but to create a<sql dbms='asany'>
change bygenerateChangelog
. OTOH that would render the changelog SQL specific, and it would not solve the problem when applying changelos to SQL Aynwhere created by other DBMSs.IMHO the current PR is the best option for most users. If users actively complain about the solution, we could later add a PR with a new option to switch it off (and reveal the bug again).
Additional Context
N/A