diff --git a/src/test/regress/bin/normalize.sed b/src/test/regress/bin/normalize.sed index 61e8cb773..4774ee081 100644 --- a/src/test/regress/bin/normalize.sed +++ b/src/test/regress/bin/normalize.sed @@ -116,3 +116,7 @@ s/pg_catalog.citus_extradata_container\([0-9]+/pg_catalog.citus_extradata_contai /replicating reference table.*$/d s/Citus.*currently supports/Citus currently supports/g + +# Warnings in multi_explain +s/prepared transaction with identifier .* does not exist/prepared transaction with identifier "citus_x_yyyyyy_zzz_w" does not exist/g +s/failed to roll back prepared transaction '.*'/failed to roll back prepared transaction 'citus_x_yyyyyy_zzz_w'/g diff --git a/src/test/regress/expected/multi_explain.out b/src/test/regress/expected/multi_explain.out index 57488c056..61c532fbf 100644 --- a/src/test/regress/expected/multi_explain.out +++ b/src/test/regress/expected/multi_explain.out @@ -1188,6 +1188,37 @@ Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=100000 width=18) Node: host=localhost port=xxxxx dbname=regression -> Index Scan using lineitem_pkey_290000 on lineitem_290000 lineitem (cost=0.28..13.60 rows=4 width=5) Index Cond: (l_orderkey = 5) +EXPLAIN (ANALYZE ON, COSTS OFF, TIMING OFF, SUMMARY OFF) EXECUTE router_executor_query_param(5); +Custom Scan (Citus Adaptive) (actual rows=3 loops=1) + Task Count: 1 + Tasks Shown: All + -> Task + Node: host=localhost port=xxxxx dbname=regression + -> Index Scan using lineitem_pkey_290000 on lineitem_290000 lineitem (actual rows=3 loops=1) + Index Cond: (l_orderkey = 5) +\set VERBOSITY TERSE +PREPARE multi_shard_query_param(int) AS UPDATE lineitem SET l_quantity = $1; +BEGIN; +EXPLAIN EXECUTE multi_shard_query_param(5); +WARNING: there is no parameter $1 +WARNING: there is no parameter $1 +Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=0 width=0) + Task Count: 2 + Tasks Shown: One of 2 + -> Task + Error: Could not get remote plan. +ROLLBACK; +BEGIN; +EXPLAIN (ANALYZE ON, COSTS OFF, TIMING OFF, SUMMARY OFF) EXECUTE multi_shard_query_param(5); +WARNING: there is no parameter $1 +WARNING: there is no parameter $1 +Custom Scan (Citus Adaptive) (actual rows=0 loops=1) + Task Count: 2 + Tasks Shown: One of 2 + -> Task + Error: Could not get remote plan. +ROLLBACK; +\set VERBOSITY DEFAULT -- test explain in a transaction with alter table to test we use right connections BEGIN; CREATE TABLE explain_table(id int); diff --git a/src/test/regress/sql/multi_explain.sql b/src/test/regress/sql/multi_explain.sql index c9b44f659..9d7301422 100644 --- a/src/test/regress/sql/multi_explain.sql +++ b/src/test/regress/sql/multi_explain.sql @@ -517,10 +517,22 @@ PREPARE real_time_executor_query AS SELECT avg(l_linenumber) FROM lineitem WHERE l_orderkey > 9030; EXPLAIN (COSTS FALSE) EXECUTE real_time_executor_query; + -- EXPLAIN EXECUTE of parametrized prepared statements is broken, but -- at least make sure to fail without crashing PREPARE router_executor_query_param(int) AS SELECT l_quantity FROM lineitem WHERE l_orderkey = $1; EXPLAIN EXECUTE router_executor_query_param(5); +EXPLAIN (ANALYZE ON, COSTS OFF, TIMING OFF, SUMMARY OFF) EXECUTE router_executor_query_param(5); + +\set VERBOSITY TERSE +PREPARE multi_shard_query_param(int) AS UPDATE lineitem SET l_quantity = $1; +BEGIN; +EXPLAIN EXECUTE multi_shard_query_param(5); +ROLLBACK; +BEGIN; +EXPLAIN (ANALYZE ON, COSTS OFF, TIMING OFF, SUMMARY OFF) EXECUTE multi_shard_query_param(5); +ROLLBACK; +\set VERBOSITY DEFAULT -- test explain in a transaction with alter table to test we use right connections BEGIN;