Skip to content

Commit

Permalink
Fix test output plan verification (babelfish-for-postgresql#2022)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
wboettge authored and Jason Teng committed Dec 24, 2023
1 parent 732031a commit 7532a63
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
33 changes: 15 additions & 18 deletions test/JDBC/expected/BABEL-4281.out
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions test/JDBC/input/BABEL-4281.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7532a63

Please sign in to comment.