timescaledb/tsl/test/shared/sql/dist_queries.sql
Sven Klemm 7f494077ed Fix DataNodeScan plans with One-Time Filter
When a query has a filter that only needs to be evaluated once per
query it will be represented as a Result node with the filter
condition on the Result node and the actual query as child of the
result node. find_data_node_scan_state_child did not consider
Result node as valid node to contain a DataNodeScan node leading
to a `unexpected child node of Append or MergeAppend: 62` for
queries that had one-time filter with a subquery.
2021-12-13 21:10:30 +01:00

15 lines
396 B
SQL

-- 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.
-- Test DataNodeScan with subquery with one-time filter
SELECT
id
FROM
insert_test
WHERE
NULL::int2 >= NULL::int2 OR
EXISTS (SELECT 1 from dist_chunk_copy WHERE insert_test.id IS NOT NULL)
ORDER BY id;