Fix tests to be resilient to possible PG planner changes.

This commit is contained in:
Pavel Borisov 2022-06-15 20:24:50 +04:00 committed by Fabrízio de Royes Mello
parent 42f197e579
commit 1fbd4116f9
2 changed files with 5 additions and 1 deletions

View File

@ -669,7 +669,7 @@ ORDER BY c.id;
\set QUERY1 'SELECT show_chunks(\'drop_chunk_test1\', newer_than=>5)::NAME'
\set QUERY2 'SELECT drop_chunks(\'drop_chunk_test1\', newer_than=>5, verbose => true)::NAME'
\set ECHO errors
psql:include/query_result_test_equal.sql:14: INFO: dropping chunk _timescaledb_internal._hyper_1_5_chunk
psql:include/query_result_test_equal.sql:16: INFO: dropping chunk _timescaledb_internal._hyper_1_5_chunk
Different Rows | Total Rows from Query 1 | Total Rows from Query 2
----------------+-------------------------+-------------------------
0 | 1 | 1

View File

@ -3,6 +3,8 @@
-- LICENSE-APACHE for a copy of the license.
--expects QUERY1 and QUERY2 to be set, expects data can be compared
set enable_hashjoin = off;
set enable_mergejoin = on;
with query1 AS (
SELECT row_number() OVER(ORDER BY q.*) row_number, * FROM (:QUERY1) as q
),
@ -12,3 +14,5 @@ query2 AS (
SELECT count(*) FILTER (WHERE query1.row_number IS DISTINCT FROM query2.row_number OR query1.show_chunks IS DISTINCT FROM query2.drop_chunks) AS "Different Rows",
coalesce(max(query1.row_number), 0) AS "Total Rows from Query 1", coalesce(max(query2.row_number), 0) AS "Total Rows from Query 2"
FROM query1 FULL OUTER JOIN query2 ON (query1.row_number = query2.row_number);
reset enable_hashjoin;
reset enable_mergejoin;