Fix getting heap tuple size

Also change corresponding tests to what they were originally in fd546cf
pull/7387/head
Karina Litskevich 2023-12-22 11:06:36 +03:00
parent 968ac74cde
commit 3841a47093
4 changed files with 12 additions and 22 deletions

View File

@ -109,7 +109,7 @@ TupleStoreTupleDestPutTuple(TupleDestination *self, Task *task,
uint64 tupleSize = tupleLibpqSize;
if (tupleSize == 0)
{
tupleSize = HeapTupleHeaderGetDatumLength(heapTuple);
tupleSize = heapTuple->t_len;
}
/*

View File

@ -203,6 +203,7 @@ DEPS = {
"foreign_key_to_reference_shard_rebalance": TestDeps(
"minimal_schedule", ["remove_coordinator_from_metadata"]
),
"limit_intermediate_size": TestDeps("base_schedule"),
}

View File

@ -16,7 +16,8 @@ SELECT cte.user_id, cte.value_2 FROM cte,cte2 ORDER BY 1,2 LIMIT 10;
ERROR: the intermediate result size exceeds citus.max_intermediate_result_size (currently 2 kB)
DETAIL: Citus restricts the size of intermediate results of complex subqueries and CTEs to avoid accidentally pulling large result sets into once place.
HINT: To run the current query, set citus.max_intermediate_result_size to a higher value or -1 to disable.
SET citus.max_intermediate_result_size TO 17;
SET citus.max_intermediate_result_size TO 9;
-- regular adaptive executor CTE should fail
WITH cte AS MATERIALIZED
(
SELECT
@ -38,20 +39,9 @@ FROM
ORDER BY
1,2
LIMIT 10;
user_id | value_2
---------------------------------------------------------------------
1 | 0
1 | 0
1 | 0
1 | 0
1 | 0
1 | 0
1 | 0
1 | 0
1 | 0
1 | 0
(10 rows)
ERROR: the intermediate result size exceeds citus.max_intermediate_result_size (currently 9 kB)
DETAIL: Citus restricts the size of intermediate results of complex subqueries and CTEs to avoid accidentally pulling large result sets into once place.
HINT: To run the current query, set citus.max_intermediate_result_size to a higher value or -1 to disable.
-- router queries should be able to get limitted too
SET citus.max_intermediate_result_size TO 2;
-- this should pass, since we fetch small portions in each subplan
@ -117,11 +107,9 @@ WITH cte AS MATERIALIZED (
AND EXISTS (select * from cte2, cte3)
)
SELECT count(*) FROM cte WHERE EXISTS (select * from cte);
count
---------------------------------------------------------------------
105
(1 row)
ERROR: the intermediate result size exceeds citus.max_intermediate_result_size (currently 4 kB)
DETAIL: Citus restricts the size of intermediate results of complex subqueries and CTEs to avoid accidentally pulling large result sets into once place.
HINT: To run the current query, set citus.max_intermediate_result_size to a higher value or -1 to disable.
SET citus.max_intermediate_result_size TO 3;
-- this should fail since the cte-subplan exceeds the limit even if the
-- cte2 and cte3 does not

View File

@ -17,7 +17,8 @@ cte2 AS MATERIALIZED (
SELECT cte.user_id, cte.value_2 FROM cte,cte2 ORDER BY 1,2 LIMIT 10;
SET citus.max_intermediate_result_size TO 17;
SET citus.max_intermediate_result_size TO 9;
-- regular adaptive executor CTE should fail
WITH cte AS MATERIALIZED
(
SELECT