]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix pg_stat_get_backend_activity() to use multi-byte truncated result
authorMichael Paquier <michael@paquier.xyz>
Sat, 27 Dec 2025 08:23:58 +0000 (17:23 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sat, 27 Dec 2025 08:23:58 +0000 (17:23 +0900)
commitea3524cffa81386aadb7eb8245d05a2ce2f71562
treea66d60da30eea31d8b11d343e1d18a8663692c98
parent7c9f4a65604c2e54f732ed939becc23db69b5bb6
Fix pg_stat_get_backend_activity() to use multi-byte truncated result

pg_stat_get_backend_activity() calls pgstat_clip_activity() to ensure
that the reported query string is correctly truncated when it finishes
with an incomplete multi-byte sequence.  However, the result returned by
the function was not what pgstat_clip_activity() generated, but the
non-truncated, original, contents from PgBackendStatus.st_activity_raw.

Oversight in 54b6cd589ac2, so backpatch all the way down.

Author: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/CAEoWx2mDzwc48q2EK9tSXS6iJMJ35wvxNQnHX+rXjy5VgLvJQw@mail.gmail.com
Backpatch-through: 14
src/backend/utils/adt/pgstatfuncs.c