mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-16 10:33:27 +08:00
Run regresscheck-shared on PG13
This patch enables the regresscheck-shared testsuite to run on PG13
This commit is contained in:
parent
2bf69fd4ca
commit
b95e93a651
3
.github/workflows/linux-build-and-test.yaml
vendored
3
.github/workflows/linux-build-and-test.yaml
vendored
@ -104,8 +104,7 @@ jobs:
|
||||
run: |
|
||||
set -o pipefail
|
||||
if [[ "${{ matrix.pg }}" == "13.1" ]]; then
|
||||
make -k -C build isolationcheck isolationcheck-t ${{ matrix.installcheck_args }} | tee installcheck.log
|
||||
make -k -C build regresscheck | tee -a installcheck.log
|
||||
make -k -C build isolationcheck isolationcheck-t regresscheck regresscheck-shared ${{ matrix.installcheck_args }} | tee installcheck.log
|
||||
else
|
||||
make -k -C build installcheck ${{ matrix.installcheck_args }} | tee installcheck.log
|
||||
fi
|
||||
|
268
tsl/test/shared/expected/constify_timestamptz_op_interval-13.out
Normal file
268
tsl/test/shared/expected/constify_timestamptz_op_interval-13.out
Normal file
@ -0,0 +1,268 @@
|
||||
-- This file and its contents are licensed under the Timescale License.
|
||||
-- Please see the included NOTICE for copyright information and
|
||||
-- LICENSE-TIMESCALE for a copy of the license.
|
||||
\set PREFIX 'EXPLAIN (costs off)'
|
||||
-- we disable ChunkAppend and ConstraintAwareAppend here to make the exclusion easier to spot
|
||||
-- otherwise those would remove the chunks from the plan during execution
|
||||
SET timescaledb.enable_chunk_append TO FALSE;
|
||||
SET timescaledb.enable_constraint_aware_append TO FALSE;
|
||||
-- plan query on complete hypertable to get a list of the chunks
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics;
|
||||
QUERY PLAN
|
||||
------------------------------------
|
||||
Append
|
||||
-> Seq Scan on _hyper_1_1_chunk
|
||||
-> Seq Scan on _hyper_1_2_chunk
|
||||
-> Seq Scan on _hyper_1_3_chunk
|
||||
(4 rows)
|
||||
|
||||
-- all of these should have all chunk exclusion happening at plan time
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time < '2000-01-01'::timestamptz - '6h'::interval;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Sat Jan 01 00:00:00 2000 PST'::timestamp with time zone - '@ 6 hours'::interval))
|
||||
(2 rows)
|
||||
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time < '2000-01-01'::timestamptz + '6h'::interval;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Sat Jan 01 00:00:00 2000 PST'::timestamp with time zone + '@ 6 hours'::interval))
|
||||
(2 rows)
|
||||
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time < '6h'::interval + '2000-01-01'::timestamptz;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Sat Jan 01 00:00:00 2000 PST'::timestamp with time zone + '@ 6 hours'::interval))
|
||||
(2 rows)
|
||||
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time < '2000-01-07'::timestamptz - '7 day 8 seconds'::interval;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Fri Jan 07 00:00:00 2000 PST'::timestamp with time zone - '@ 7 days 8 secs'::interval))
|
||||
(2 rows)
|
||||
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time < '2000-03-01'::timestamptz - '60 day'::interval;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Wed Mar 01 00:00:00 2000 PST'::timestamp with time zone - '@ 60 days'::interval))
|
||||
(2 rows)
|
||||
|
||||
-- test Var on right side of expression
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE '2000-01-01'::timestamptz - '6h'::interval > time;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Sat Jan 01 00:00:00 2000 PST'::timestamp with time zone - '@ 6 hours'::interval))
|
||||
(2 rows)
|
||||
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE '2000-01-07'::timestamptz - '7 day'::interval > time;
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Fri Jan 07 00:00:00 2000 PST'::timestamp with time zone - '@ 7 days'::interval))
|
||||
(2 rows)
|
||||
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE '2000-03-01'::timestamptz - '60 day'::interval > time;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Wed Mar 01 00:00:00 2000 PST'::timestamp with time zone - '@ 60 days'::interval))
|
||||
(2 rows)
|
||||
|
||||
-- test multiple constraints
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time > '2000-01-10'::timestamptz - '6h'::interval
|
||||
AND time < '2000-01-10'::timestamptz + '6h'::interval;
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Index Only Scan using _hyper_1_2_chunk_metrics_time_idx on _hyper_1_2_chunk
|
||||
Index Cond: (("time" > ('Mon Jan 10 00:00:00 2000 PST'::timestamp with time zone - '@ 6 hours'::interval)) AND ("time" < ('Mon Jan 10 00:00:00 2000 PST'::timestamp with time zone + '@ 6 hours'::interval)))
|
||||
(2 rows)
|
||||
|
||||
-- test on space-partitioned hypertable
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics_space
|
||||
WHERE time < '2000-01-01'::timestamptz - '6h'::interval
|
||||
AND device_id = 1;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
Index Scan using _hyper_2_4_chunk_metrics_space_time_idx on _hyper_2_4_chunk
|
||||
Index Cond: ("time" < ('Sat Jan 01 00:00:00 2000 PST'::timestamp with time zone - '@ 6 hours'::interval))
|
||||
Filter: (device_id = 1)
|
||||
(3 rows)
|
||||
|
||||
-- test on compressed hypertable
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics_compressed
|
||||
WHERE time < '2000-01-01'::timestamptz - '6h'::interval;
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
Custom Scan (DecompressChunk) on _hyper_3_13_chunk
|
||||
Filter: ("time" < ('Sat Jan 01 00:00:00 2000 PST'::timestamp with time zone - '@ 6 hours'::interval))
|
||||
-> Seq Scan on compress_hyper_4_18_chunk
|
||||
Filter: (_ts_meta_min_1 < ('Sat Jan 01 00:00:00 2000 PST'::timestamp with time zone - '@ 6 hours'::interval))
|
||||
(4 rows)
|
||||
|
||||
-- test on space-partitioned compressed hypertable
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics_space_compressed
|
||||
WHERE time < '2000-01-01'::timestamptz - '6h'::interval
|
||||
AND device_id = 1;
|
||||
QUERY PLAN
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Custom Scan (DecompressChunk) on _hyper_5_19_chunk
|
||||
Filter: ("time" < ('Sat Jan 01 00:00:00 2000 PST'::timestamp with time zone - '@ 6 hours'::interval))
|
||||
-> Seq Scan on compress_hyper_6_36_chunk
|
||||
Filter: ((device_id = 1) AND (_ts_meta_min_1 < ('Sat Jan 01 00:00:00 2000 PST'::timestamp with time zone - '@ 6 hours'::interval)))
|
||||
(4 rows)
|
||||
|
||||
-- month/year intervals are not constified
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time < '2000-02-01'::timestamptz - '1 month'::interval;
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
Append
|
||||
-> Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 mon'::interval))
|
||||
-> Index Only Scan using _hyper_1_2_chunk_metrics_time_idx on _hyper_1_2_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 mon'::interval))
|
||||
-> Index Only Scan using _hyper_1_3_chunk_metrics_time_idx on _hyper_1_3_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 mon'::interval))
|
||||
(7 rows)
|
||||
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time < '2000-02-01'::timestamptz - '1 month - 1 day'::interval;
|
||||
QUERY PLAN
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
Append
|
||||
-> Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 mon -1 days'::interval))
|
||||
-> Index Only Scan using _hyper_1_2_chunk_metrics_time_idx on _hyper_1_2_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 mon -1 days'::interval))
|
||||
-> Index Only Scan using _hyper_1_3_chunk_metrics_time_idx on _hyper_1_3_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 mon -1 days'::interval))
|
||||
(7 rows)
|
||||
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time < '2000-02-01'::timestamptz - '1 month + 1 day'::interval;
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
Append
|
||||
-> Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 mon 1 day'::interval))
|
||||
-> Index Only Scan using _hyper_1_2_chunk_metrics_time_idx on _hyper_1_2_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 mon 1 day'::interval))
|
||||
-> Index Only Scan using _hyper_1_3_chunk_metrics_time_idx on _hyper_1_3_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 mon 1 day'::interval))
|
||||
(7 rows)
|
||||
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE '2000-02-01'::timestamptz - '1 year'::interval > time;
|
||||
QUERY PLAN
|
||||
------------------------------------------------------------------------------------------------------------------
|
||||
Append
|
||||
-> Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 year'::interval))
|
||||
-> Index Only Scan using _hyper_1_2_chunk_metrics_time_idx on _hyper_1_2_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 year'::interval))
|
||||
-> Index Only Scan using _hyper_1_3_chunk_metrics_time_idx on _hyper_1_3_chunk
|
||||
Index Cond: ("time" < ('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone - '@ 1 year'::interval))
|
||||
(7 rows)
|
||||
|
||||
-- nested expressions are not constified
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time < '1 day' + '2000-02-01'::timestamptz - '1 month'::interval;
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
Append
|
||||
-> Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" < (('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone + '@ 1 day'::interval) - '@ 1 mon'::interval))
|
||||
-> Index Only Scan using _hyper_1_2_chunk_metrics_time_idx on _hyper_1_2_chunk
|
||||
Index Cond: ("time" < (('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone + '@ 1 day'::interval) - '@ 1 mon'::interval))
|
||||
-> Index Only Scan using _hyper_1_3_chunk_metrics_time_idx on _hyper_1_3_chunk
|
||||
Index Cond: ("time" < (('Tue Feb 01 00:00:00 2000 PST'::timestamp with time zone + '@ 1 day'::interval) - '@ 1 mon'::interval))
|
||||
(7 rows)
|
||||
|
||||
-- non-Const expressions are not constified
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time > now() - '6h'::interval;
|
||||
QUERY PLAN
|
||||
-----------------------------------------------------------------------------------
|
||||
Append
|
||||
-> Index Only Scan using _hyper_1_1_chunk_metrics_time_idx on _hyper_1_1_chunk
|
||||
Index Cond: ("time" > (now() - '@ 6 hours'::interval))
|
||||
-> Index Only Scan using _hyper_1_2_chunk_metrics_time_idx on _hyper_1_2_chunk
|
||||
Index Cond: ("time" > (now() - '@ 6 hours'::interval))
|
||||
-> Index Only Scan using _hyper_1_3_chunk_metrics_time_idx on _hyper_1_3_chunk
|
||||
Index Cond: ("time" > (now() - '@ 6 hours'::interval))
|
||||
(7 rows)
|
||||
|
||||
-- test NULL values
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time < '2000-02-01'::timestamptz - NULL::interval;
|
||||
QUERY PLAN
|
||||
--------------------------
|
||||
Result
|
||||
One-Time Filter: false
|
||||
(2 rows)
|
||||
|
||||
:PREFIX
|
||||
SELECT time
|
||||
FROM metrics
|
||||
WHERE time < NULL::timestamptz - NULL::interval;
|
||||
QUERY PLAN
|
||||
--------------------------
|
||||
Result
|
||||
One-Time Filter: false
|
||||
(2 rows)
|
||||
|
@ -13,6 +13,13 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
|
||||
\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
|
||||
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||
set work_mem to '64MB';
|
||||
-- disable incremental sort here to make plans comparable to PG < 13
|
||||
SELECT CASE WHEN current_setting('server_version_num')::int/10000 >= 13 THEN set_config('enable_incremental_sort','off',false) ELSE 'off' END;
|
||||
case
|
||||
------
|
||||
off
|
||||
(1 row)
|
||||
|
||||
set max_parallel_workers_per_gather to 0;
|
||||
\set TEST_TABLE 'metrics'
|
||||
\ir :TEST_QUERY_NAME
|
||||
|
3117
tsl/test/shared/expected/gapfill-12.out
Normal file
3117
tsl/test/shared/expected/gapfill-12.out
Normal file
File diff suppressed because one or more lines are too long
3124
tsl/test/shared/expected/gapfill-13.out
Normal file
3124
tsl/test/shared/expected/gapfill-13.out
Normal file
File diff suppressed because one or more lines are too long
4459
tsl/test/shared/expected/ordered_append-13.out
Normal file
4459
tsl/test/shared/expected/ordered_append-13.out
Normal file
File diff suppressed because it is too large
Load Diff
3862
tsl/test/shared/expected/ordered_append_join-12.out
Normal file
3862
tsl/test/shared/expected/ordered_append_join-12.out
Normal file
File diff suppressed because it is too large
Load Diff
3862
tsl/test/shared/expected/ordered_append_join-13.out
Normal file
3862
tsl/test/shared/expected/ordered_append_join-13.out
Normal file
File diff suppressed because it is too large
Load Diff
2
tsl/test/shared/sql/.gitignore
vendored
2
tsl/test/shared/sql/.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
/constify_timestamptz_op_interval-*.sql
|
||||
/gapfill-*.sql
|
||||
/ordered_append-*.sql
|
||||
/ordered_append_join-*.sql
|
||||
|
@ -3,13 +3,13 @@ set(TEST_FILES_SHARED
|
||||
decompress_placeholdervar.sql
|
||||
dist_gapfill.sql
|
||||
dist_insert.sql
|
||||
gapfill.sql
|
||||
ordered_append_join.sql
|
||||
)
|
||||
|
||||
set(TEST_TEMPLATES_SHARED
|
||||
constify_timestamptz_op_interval.sql.in
|
||||
gapfill.sql.in
|
||||
ordered_append.sql.in
|
||||
ordered_append_join.sql.in
|
||||
)
|
||||
|
||||
# Regression tests that vary with PostgreSQL version. Generated test
|
||||
|
@ -16,6 +16,8 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
|
||||
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
|
||||
|
||||
set work_mem to '64MB';
|
||||
-- disable incremental sort here to make plans comparable to PG < 13
|
||||
SELECT CASE WHEN current_setting('server_version_num')::int/10000 >= 13 THEN set_config('enable_incremental_sort','off',false) ELSE 'off' END;
|
||||
|
||||
set max_parallel_workers_per_gather to 0;
|
||||
\set TEST_TABLE 'metrics'
|
||||
|
Loading…
x
Reference in New Issue
Block a user