Skip to content

PG-2116 Truncate query strings at multi-byte character boundaries#600

Merged
jeltz merged 1 commit intopercona:mainfrom
jeltz:query-mb-truncation
Jan 12, 2026
Merged

PG-2116 Truncate query strings at multi-byte character boundaries#600
jeltz merged 1 commit intopercona:mainfrom
jeltz:query-mb-truncation

Conversation

@jeltz
Copy link
Contributor

@jeltz jeltz commented Dec 23, 2025

Make sure we never create broken encodings in query strings by making the truncation of query strings multi-byte aware. An alternative would be to change the rule for truncation to be based on number of characters, as the documentation claims it is, but I do not think that would be significantly better. Either works just fine so we just pick one.

Based on bug report from Ivan Vyazmitinov:

#599

@AndersAstrand
Copy link
Contributor

The code looks good to me, but should all those test really fail? I see some of them succeed on other PRs

Make sure we never create broken encodings in query strings by making
the truncation of query strings multi-byte aware. An alternative would
be to change the rule for truncation to be based on number of
characters, as the documentation claims it is, but I do not think that
would be significantly better. Either works just fine so we just pick
one.

Based on bug report from Ivan Vyazmitinov:

percona#599
@jeltz jeltz force-pushed the query-mb-truncation branch from ecfdf5d to 28e26ae Compare January 11, 2026 23:10
@jeltz
Copy link
Contributor Author

jeltz commented Jan 11, 2026

These PMM related tests fail in your PR too (#602). We should look into them but they are most likely cause by some change in PMM.

@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.49%. Comparing base (966bf24) to head (28e26ae).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #600      +/-   ##
==========================================
- Coverage   85.61%   85.49%   -0.13%     
==========================================
  Files           3        3              
  Lines        1342     1344       +2     
  Branches      215      216       +1     
==========================================
  Hits         1149     1149              
- Misses         91       92       +1     
- Partials      102      103       +1     

☔ View full report in Codecov by Sentry.
📢 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.

@AndersAstrand
Copy link
Contributor

These PMM related tests fail in your PR too (#602). We should look into them but they are most likely cause by some change in PMM.

Yeah, but when I looked there was also some other workflows with failed status. seems to have worked now so probably flaky tests or something.

@jeltz
Copy link
Contributor Author

jeltz commented Jan 12, 2026

Yeah, but when I looked there was also some other workflows with failed status. seems to have worked now so probably flaky tests or something.

Ah, then those likely disappeared when I rebased and pushed.

@jeltz jeltz merged commit 5526e41 into percona:main Jan 12, 2026
21 of 24 checks passed
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.

3 participants