Skip to content

Clean up get_pgsm_query_id_hash()#761

Open
jeltz wants to merge 1 commit into
percona:mainfrom
jeltz:simplify-query-id-hash
Open

Clean up get_pgsm_query_id_hash()#761
jeltz wants to merge 1 commit into
percona:mainfrom
jeltz:simplify-query-id-hash

Conversation

@jeltz

@jeltz jeltz commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

The function was unnecessarily convoluted so clean it up by making the parser easier to read, asserting against NULL input and wrapping the comment at the right width. Especially the code for handling whitespace was much more complicated than necessary.

PG-0

The function was unnecessarily convoluted so clean it up by making the
parser easier to read, asserting against NULL input and wrapping the
comment at the right width. Especially the code for handling whitespace
was much more complicated than necessary.
@jeltz jeltz force-pushed the simplify-query-id-hash branch from 11b3e21 to f9bf633 Compare July 5, 2026 12:02
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.57%. Comparing base (86edb37) to head (f9bf633).

Files with missing lines Patch % Lines
src/pg_stat_monitor.c 90.90% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #761      +/-   ##
==========================================
+ Coverage   88.33%   88.57%   +0.23%     
==========================================
  Files           3        3              
  Lines        1329     1330       +1     
  Branches      201      196       -5     
==========================================
+ Hits         1174     1178       +4     
  Misses         72       72              
+ Partials       83       80       -3     

☔ 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.

@dutow dutow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

a SPACE /* */ SPACE b now emits a SPACE SPACE b, previously it was a SPACE b, which results in a different hash. Is this something that can cause issues on upgrade? Also this means that it is no longer strictly independent of comments.

@jeltz

jeltz commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Ouch, good point. That was a stupid bug for me to introduce.

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