summaryrefslogtreecommitdiff
path: root/src/test/modules/injection_points/sql
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2025-07-10 10:01:10 +0900
committerMichael Paquier <michael@paquier.xyz>2025-07-10 10:01:20 +0900
commit4eca711bc991954613261b7a314b1e8f5963815c (patch)
treef33b7f5d4a9bd5546459f21ef33348d2b5b008d1 /src/test/modules/injection_points/sql
parent48a23f6eae710d2c5c29f38e66d76e7919117e4d (diff)
injection_points: Add injection_points_list()
This function can be used to retrieve the information about all the injection points attached to a cluster, providing coverage for InjectionPointList() introduced in 7b2eb72b1b8c. The original proposal turned around a system function, but that would not be backpatchable to stable branches. It was also a bit weird to have a system function that fails depending on if the build allows injection points or not. Reviewed-by: Aleksander Alekseev <aleksander@timescale.com> Reviewed-by: Rahila Syed <rahilasyed90@gmail.com> Discussion: https://postgr.es/m/Z_xYkA21KyLEHvWR@paquier.xyz
Diffstat (limited to 'src/test/modules/injection_points/sql')
-rw-r--r--src/test/modules/injection_points/sql/injection_points.sql7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/modules/injection_points/sql/injection_points.sql b/src/test/modules/injection_points/sql/injection_points.sql
index d9748331c77..874421e9c11 100644
--- a/src/test/modules/injection_points/sql/injection_points.sql
+++ b/src/test/modules/injection_points/sql/injection_points.sql
@@ -18,6 +18,9 @@ SELECT injection_points_attach('TestInjectionError', 'error');
SELECT injection_points_attach('TestInjectionLog', 'notice');
SELECT injection_points_attach('TestInjectionLog2', 'notice');
+SELECT point_name, library, function FROM injection_points_list()
+ ORDER BY point_name COLLATE "C";
+
SELECT injection_points_run('TestInjectionBooh'); -- nothing
SELECT injection_points_run('TestInjectionLog2'); -- notice
SELECT injection_points_run('TestInjectionLog2', NULL); -- notice
@@ -85,5 +88,9 @@ SELECT injection_points_detach('TestConditionError');
SELECT injection_points_attach('TestConditionLocal1', 'error');
SELECT injection_points_detach('TestConditionLocal1');
+-- No points should be left around.
+SELECT point_name, library, function FROM injection_points_list()
+ ORDER BY point_name COLLATE "C";
+
DROP EXTENSION injection_points;
DROP FUNCTION wait_pid;