Skip to content

Commit

Permalink
Improve test portability of plpgsql scenario
Browse files Browse the repository at this point in the history
This test expects query IDs to be computed without the hint table,
checking that compute_query_id is either "on" or "auto" when running the
tests.  The test would fail should compute_query_id be set to off on a
cluster where the regression tests are run.

There are no reasons why the test should not just use compute_query_id =
on now that we don't depend on pg_stat_statements anymore since
8e296b6 for the regression tests of pg_hint_plan.  So let's just
force it, improving the portability of the tests.

Backpatch-through: 17
  • Loading branch information
michaelpq committed Aug 6, 2024
1 parent 54082fe commit daf31ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions expected/plpgsql.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ SET client_min_messages TO log;
\set SHOW_CONTEXT always
LOAD 'pg_hint_plan';
SET pg_hint_plan.debug_print TO on;
SELECT setting <> 'off' FROM pg_settings WHERE name = 'compute_query_id';
?column?
----------
t
(1 row)

SET compute_query_id = on;
SHOW pg_hint_plan.enable_hint_table;
pg_hint_plan.enable_hint_table
--------------------------------
Expand Down
2 changes: 1 addition & 1 deletion sql/plpgsql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SET client_min_messages TO log;

LOAD 'pg_hint_plan';
SET pg_hint_plan.debug_print TO on;
SELECT setting <> 'off' FROM pg_settings WHERE name = 'compute_query_id';
SET compute_query_id = on;
SHOW pg_hint_plan.enable_hint_table;

-- Internal handling of hints within plpgsql functions.
Expand Down

0 comments on commit daf31ab

Please sign in to comment.