improve console logic for view updatability check (fix #2667) #2668
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently, the console checks
is_updatable, andis_insertable_intoto check whether to display permissions for insert, update and delete. However, for slightly more complex view with an associatedINSTEAD OFtrigger, theis_updatable, andis_insertable_intomight be'NO', while the is_trigger_insertable_into, is_trigger_updatable, is_trigger_deletable columns might be'YES'. In this case, we would still like to be able to set permissions for these operations.Affected components
Related Issues
#2667
Solution and Design
This PR adds in checks for the is_trigger_* columns when determining whether to display insert, update, and delete permissions.
Steps to test and verify
See #2667 for an example schema for testing and verifying the fix.
Limitations, known bugs & workarounds
This PR is fairly minimal in terms of adding in use of the necessary columns. However, given that
hdb_catalog.hdb_table_info_agg.view_infoalso exposes required information more concisely, it might be worth looking into replacing the entireinformation_schemaquery with one tohdb_catalog.hdb_table_info_agg, for the purposes of centralising logic, but that's well out of scope for this PR.