Skip to content

Clean up spaghetti code in ExecutorCheckPerms_hook#660

Open
jeltz wants to merge 1 commit into
percona:mainfrom
jeltz:clean-perm-hook
Open

Clean up spaghetti code in ExecutorCheckPerms_hook#660
jeltz wants to merge 1 commit into
percona:mainfrom
jeltz:clean-perm-hook

Conversation

@jeltz
Copy link
Copy Markdown
Contributor

@jeltz jeltz commented Jun 4, 2026

The code in our ExecutorCheckPerms_hook was almost impossible to read so cleaned it up so people can understand it. Some of the changes include:

  • Use argument names from PostgreSQL
  • Use REL_LST as array size instead of 20
  • Use RELKIND_VIEW instead of 'v'
  • Reduce the number of scopes'
  • Add a couple of comments

@jeltz jeltz force-pushed the clean-perm-hook branch from 559201e to 1155669 Compare June 4, 2026 17:16
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.45%. Comparing base (ac4a4f7) to head (52babae).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pg_stat_monitor.c 90.90% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #660      +/-   ##
==========================================
+ Coverage   86.31%   86.45%   +0.13%     
==========================================
  Files           3        3              
  Lines        1345     1344       -1     
  Branches      218      218              
==========================================
+ Hits         1161     1162       +1     
+ Misses         87       86       -1     
+ Partials       97       96       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jeltz jeltz force-pushed the clean-perm-hook branch from 1155669 to 7d47af1 Compare June 4, 2026 17:22
@jeltz jeltz force-pushed the clean-perm-hook branch from 7d47af1 to 5a345a9 Compare June 5, 2026 16:46
The code in our ExecutorCheckPerms_hook was almost impossible to read so
cleaned it up so people can understand it. Some of the changes include:

- Use argument names from PostgreSQL
- Use REL_LST as array size instead of 20
- Use RELKIND_VIEW instead of 'v'
- Reduce the number of scopes
- Add a couple of comments
@jeltz jeltz force-pushed the clean-perm-hook branch from 5a345a9 to 52babae Compare June 5, 2026 17:19
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.

2 participants