mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-18 03:23:37 +08:00
Change the test from using the old x_diff method to the new direct diff method for checking that the results don't differ in the optimized and unoptimized cases. This cleans up the golden file so that in case of success the golden files are nearly empty instead of containing a diff file that must be checked to ensure that it only has explain (and not tuple) output. Also combine several test files into query.sql, and get rid of differences in pg versions.
34 lines
1.1 KiB
SQL
34 lines
1.1 KiB
SQL
-- This file and its contents are licensed under the Apache License 2.0.
|
|
-- Please see the included NOTICE for copyright information and
|
|
-- LICENSE-APACHE for a copy of the license.
|
|
|
|
\set TEST_BASE_NAME query
|
|
SELECT format('include/%s_load.sql', :'TEST_BASE_NAME') as "TEST_LOAD_NAME",
|
|
format('include/%s_query.sql', :'TEST_BASE_NAME') as "TEST_QUERY_NAME",
|
|
format('%s/results/%s_results_optimized.out', :'TEST_OUTPUT_DIR', :'TEST_BASE_NAME') as "TEST_RESULTS_OPTIMIZED",
|
|
format('%s/results/%s_results_unoptimized.out', :'TEST_OUTPUT_DIR', :'TEST_BASE_NAME') as "TEST_RESULTS_UNOPTIMIZED"
|
|
\gset
|
|
SELECT format('\! diff %s %s', :'TEST_RESULTS_OPTIMIZED', :'TEST_RESULTS_UNOPTIMIZED') as "DIFF_CMD"
|
|
\gset
|
|
|
|
\set PREFIX 'EXPLAIN (costs OFF)'
|
|
\ir :TEST_LOAD_NAME
|
|
\ir :TEST_QUERY_NAME
|
|
|
|
--generate the results into two different files
|
|
\set ECHO errors
|
|
SET client_min_messages TO error;
|
|
--make output contain query results
|
|
\set PREFIX ''
|
|
\o :TEST_RESULTS_OPTIMIZED
|
|
SET timescaledb.disable_optimizations = 'off';
|
|
\ir :TEST_QUERY_NAME
|
|
\o
|
|
\o :TEST_RESULTS_UNOPTIMIZED
|
|
SET timescaledb.disable_optimizations = 'on';
|
|
\ir :TEST_QUERY_NAME
|
|
\o
|
|
|
|
:DIFF_CMD
|
|
SELECT 'Done'
|