pgsql: test_custom_stats: Add test for drop of variable-sized stats kin

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: test_custom_stats: Add test for drop of variable-sized stats kin
Date: 2026-11-03 23:05:44
Message-ID: E1xONZZ-000000004dA-0UVQ@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

test_custom_stats: Add test for drop of variable-sized stats kind

pgstat_drop_matching_entries() with a non-NULL callback while scanning
all the variable-numbered stats kinds had no test coverage. d52c24b0f80
had an equivalent in the test module injection_points, that had no
coverage since the tests for custom stats kinds have been moved to
test_custom_stats.

This commit adds an equivalent coverage here by dropping all the custom
variable-sized stats entries through pgstat_drop_matching_entries(). An
extra test checking that other variable-sized stats kinds are untouched
is included.

This is a hole in the tests of v19, but it's not critical in any way so
no backpatch is done.

Author: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/aufa5srSxC4pu5OF@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8e225d2ac57dd4e801e452c9398da4983c2d67b0

Modified Files
--------------
.../test_custom_stats/t/001_custom_stats.pl | 17 ++++++++++++++++
.../test_custom_var_stats--1.0.sql | 5 +++++
.../test_custom_stats/test_custom_var_stats.c | 23 ++++++++++++++++++++++
3 files changed, 45 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2026-11-03 23:39:46 pgsql: Improve stability of authentication test 007_pre_auth
Previous Message Robert Haas 2026-11-03 15:28:50 pgsql: pg_plan_advice: Handle custom scans that replace a join