From 7532a6397b88394979eb48c2ea45b28b9c62c726 Mon Sep 17 00:00:00 2001 From: Walt Boettge Date: Fri, 17 Nov 2023 15:00:02 -0600 Subject: [PATCH] Fix test output plan verification (#2022) Test BABEL-4281 gives the memory usage with STATISTICS PROFILE. During testing, this value can change, causing test failures. Switching to SHOWPLAN_ALL will give a plan without outputing memory usage. Signed-off-by: Walt Boettge --- test/JDBC/expected/BABEL-4281.out | 33 ++++++++++++++----------------- test/JDBC/input/BABEL-4281.sql | 9 ++++++--- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/JDBC/expected/BABEL-4281.out b/test/JDBC/expected/BABEL-4281.out index 585637ac544..d3a6d420a0d 100644 --- a/test/JDBC/expected/BABEL-4281.out +++ b/test/JDBC/expected/BABEL-4281.out @@ -51,40 +51,37 @@ off ~~END~~ -SET BABELFISH_STATISTICS PROFILE ON +SET BABELFISH_SHOWPLAN_ALL ON GO select a, count(*) from t_babel4281 group by a order by 2; -- should not crash GO -~~START~~ -int#!#int -~~END~~ - ~~START~~ text Query Text: select a, count(*) from t_babel4281 group by a order by 2 -Sort (actual rows=0 loops=1) +Sort Sort Key: (count(*)) NULLS FIRST - Sort Method: quicksort Memory: 25kB - -> Finalize HashAggregate (actual rows=0 loops=1) + -> Finalize HashAggregate Group Key: a - Batches: 1 Memory Usage: 40kB - -> Gather (actual rows=0 loops=1) + -> Gather Workers Planned: 2 - Workers Launched: 2 - -> Partial HashAggregate (actual rows=0 loops=3) + -> Partial HashAggregate Group Key: a - Batches: 1 Memory Usage: 40kB - Worker 0: Batches: 1 Memory Usage: 40kB - Worker 1: Batches: 1 Memory Usage: 40kB - -> Parallel Seq Scan on t_babel4281 (actual rows=0 loops=3) + -> Parallel Seq Scan on t_babel4281 ~~END~~ - -- set configurations back -SET BABELFISH_STATISTICS PROFILE OFF +SET BABELFISH_SHOWPLAN_ALL OFF +GO + +-- Verify Output +select a, count(*) from t_babel4281 group by a order by 2; -- should not crash GO +~~START~~ +int#!#int +~~END~~ + select set_config('babelfishpg_tsql.explain_timing', 'on', false); GO diff --git a/test/JDBC/input/BABEL-4281.sql b/test/JDBC/input/BABEL-4281.sql index 94f52e8180a..7113fd63731 100644 --- a/test/JDBC/input/BABEL-4281.sql +++ b/test/JDBC/input/BABEL-4281.sql @@ -21,15 +21,18 @@ GO select set_config('babelfishpg_tsql.explain_costs', 'off', false); GO -SET BABELFISH_STATISTICS PROFILE ON +SET BABELFISH_SHOWPLAN_ALL ON GO select a, count(*) from t_babel4281 group by a order by 2; -- should not crash GO - -- set configurations back -SET BABELFISH_STATISTICS PROFILE OFF +SET BABELFISH_SHOWPLAN_ALL OFF +GO + +-- Verify Output +select a, count(*) from t_babel4281 group by a order by 2; -- should not crash GO select set_config('babelfishpg_tsql.explain_timing', 'on', false);