Skip to content

builtins: fix pg_function_is_visible to work with UDFs#90657

Merged
craig[bot] merged 3 commits intocockroachdb:masterfrom
rafiss:fix-func-is-visible
Dec 13, 2022
Merged

builtins: fix pg_function_is_visible to work with UDFs#90657
craig[bot] merged 3 commits intocockroachdb:masterfrom
rafiss:fix-func-is-visible

Conversation

@rafiss
Copy link
Copy Markdown
Collaborator

@rafiss rafiss commented Oct 25, 2022

fixes #89546

builtins: fix pg_function_is_visible to work with UDFs

Release note (bug fix): The pg_function_is_visible function now
correctly reports visibility based on the functions that are visible on
the current search_path.

builtins: use pg_type to implement pg_type_is_visible

This saves us from having to maintain the old code, which I personally
found to be a bit hard to work with. Using the internal executor like
this should be faster than it used to be, since there is an index on
pg_type(oid) that will avoid any lookups for builtin types.

sessiondata: consolidate logic for searching the search_path

@rafiss rafiss changed the title sql: remove deprecated function from DatabaseCatalog builtins: fix pg_function_is_visible to work with UDFs Oct 25, 2022
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@rafiss rafiss force-pushed the fix-func-is-visible branch 3 times, most recently from 262a557 to 7854205 Compare October 26, 2022 14:55
Release note (bug fix): The pg_function_is_visible function now
correctly reports visibility based on the functions that are visible on
the current search_path.
@rafiss rafiss force-pushed the fix-func-is-visible branch 2 times, most recently from f6dad5d to 0f347b4 Compare December 10, 2022 08:58
This saves us from having to maintain the old code, which I personally
found to be a bit hard to work with. Using the internal executor like
this should be faster than it used to be, since there is an index on
pg_type(oid) that will avoid any lookups for builtin types.

Release note: None
@rafiss rafiss force-pushed the fix-func-is-visible branch from 0f347b4 to 9d330c7 Compare December 10, 2022 18:22
@rafiss rafiss marked this pull request as ready for review December 12, 2022 15:42
@rafiss rafiss requested review from a team December 12, 2022 15:42
Copy link
Copy Markdown
Contributor

@e-mbrown e-mbrown left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r1, 5 of 5 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @rafiss)

@rafiss
Copy link
Copy Markdown
Collaborator Author

rafiss commented Dec 12, 2022

tftr!

bors r=e-mbrown

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 12, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 13, 2022

Build failed (retrying...):

@rafiss
Copy link
Copy Markdown
Collaborator Author

rafiss commented Dec 13, 2022

bors r=e-mbrown

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 13, 2022

Already running a review

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 13, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 13, 2022

Build failed:

@rafiss
Copy link
Copy Markdown
Collaborator Author

rafiss commented Dec 13, 2022

bors r=e-mbrown

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 13, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 13, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 13, 2022

Build succeeded:

@craig craig bot merged commit 16c786f into cockroachdb:master Dec 13, 2022
@rafiss rafiss deleted the fix-func-is-visible branch December 14, 2022 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sql: pg_function_is_visible is not correct for UDFs

3 participants