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

Fix information schema for catalogs with system security #11694

Merged
merged 1 commit into from
Mar 29, 2022

Conversation

dain
Copy link
Member

@dain dain commented Mar 29, 2022

Description

Fix information_schema role tables for catalogs using system roles. Before this change the querying the tables would simply throw an exception.

Documentation

(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

( ) No release notes entries required.
(x) Release notes entries required with the following suggested text:

# Section
* Fix failures in information schema role tables for catalogs using system roles. ({issue}`11694`)

@dain dain requested a review from electrum March 29, 2022 01:47
@cla-bot cla-bot bot added the cla-signed label Mar 29, 2022
@@ -344,14 +344,15 @@ private void addTablePrivilegesRecords(QualifiedTablePrefix prefix)

private void addRolesRecords()
{
Optional<String> catalogName = metadata.isCatalogManagedSecurity(session, this.catalogName) ? Optional.of(this.catalogName) : Optional.empty();
Copy link
Member

Choose a reason for hiding this comment

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

Might be cleaner to use Optional.filter

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried that and it was less awesome

@dain dain merged commit 7f954b5 into trinodb:master Mar 29, 2022
@dain dain deleted the fix-information-schema-system-roles branch March 29, 2022 03:58
@github-actions github-actions bot added this to the 376 milestone Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants