diff --git a/src/test/regress/expected/failure_copy_on_hash.out b/src/test/regress/expected/failure_copy_on_hash.out index 424ab0da85d..35cb690c866 100644 --- a/src/test/regress/expected/failure_copy_on_hash.out +++ b/src/test/regress/expected/failure_copy_on_hash.out @@ -270,7 +270,9 @@ SELECT citus.mitmproxy('conn.kill()'); (1 row) -\COPY test_table_2 FROM stdin delimiter ','; +-- Deliberately use zero-row input; modern psql drains failed COPY input +-- through the next \. (#8780). +\COPY test_table_2 FROM PROGRAM 'true' delimiter ','; ERROR: connection to the remote node postgres@localhost:xxxxx failed with the following error: connection not open SELECT citus.mitmproxy('conn.allow()'); mitmproxy diff --git a/src/test/regress/expected/failure_copy_to_reference.out b/src/test/regress/expected/failure_copy_to_reference.out index 8c610572edb..12bfd1fe21f 100644 --- a/src/test/regress/expected/failure_copy_to_reference.out +++ b/src/test/regress/expected/failure_copy_to_reference.out @@ -34,7 +34,9 @@ SELECT citus.mitmproxy('conn.kill()'); (1 row) -\copy test_table FROM STDIN DELIMITER ',' +-- Deliberately use zero-row input for the next three failures; modern psql +-- drains failed COPY input through the next \. (#8780). +\copy test_table FROM PROGRAM 'true' DELIMITER ',' ERROR: failure on connection marked as essential: localhost:xxxxx SELECT citus.mitmproxy('conn.allow()'); mitmproxy @@ -61,7 +63,7 @@ SELECT citus.mitmproxy('conn.onQuery(query="^BEGIN TRANSACTION ISOLATION LEVEL R (1 row) -\copy test_table FROM STDIN DELIMITER ',' +\copy test_table FROM PROGRAM 'true' DELIMITER ',' ERROR: failure on connection marked as essential: localhost:xxxxx SELECT citus.mitmproxy('conn.allow()'); mitmproxy @@ -88,7 +90,7 @@ SELECT citus.mitmproxy('conn.onQuery(query="^BEGIN TRANSACTION ISOLATION LEVEL R (1 row) -\copy test_table FROM STDIN DELIMITER ',' +\copy test_table FROM PROGRAM 'true' DELIMITER ',' ERROR: canceling statement due to user request SELECT citus.mitmproxy('conn.allow()'); mitmproxy diff --git a/src/test/regress/sql/failure_copy_on_hash.sql b/src/test/regress/sql/failure_copy_on_hash.sql index d60242803c4..91e18b42bf0 100644 --- a/src/test/regress/sql/failure_copy_on_hash.sql +++ b/src/test/regress/sql/failure_copy_on_hash.sql @@ -141,7 +141,9 @@ SELECT create_distributed_table('test_table_2','id'); SELECT citus.mitmproxy('conn.kill()'); -\COPY test_table_2 FROM stdin delimiter ','; +-- Deliberately use zero-row input; modern psql drains failed COPY input +-- through the next \. (#8780). +\COPY test_table_2 FROM PROGRAM 'true' delimiter ','; SELECT citus.mitmproxy('conn.allow()'); SELECT pds.logicalrelid, pdsd.shardid, pdsd.shardstate diff --git a/src/test/regress/sql/failure_copy_to_reference.sql b/src/test/regress/sql/failure_copy_to_reference.sql index b6c8d6c81aa..3e686ab5fc8 100644 --- a/src/test/regress/sql/failure_copy_to_reference.sql +++ b/src/test/regress/sql/failure_copy_to_reference.sql @@ -24,21 +24,23 @@ CREATE VIEW unhealthy_shard_count AS -- in the first test, kill just in the first -- response we get from the worker SELECT citus.mitmproxy('conn.kill()'); -\copy test_table FROM STDIN DELIMITER ',' +-- Deliberately use zero-row input for the next three failures; modern psql +-- drains failed COPY input through the next \. (#8780). +\copy test_table FROM PROGRAM 'true' DELIMITER ',' SELECT citus.mitmproxy('conn.allow()'); SELECT * FROM unhealthy_shard_count; SELECT count(*) FROM test_table; -- kill as soon as the coordinator sends begin SELECT citus.mitmproxy('conn.onQuery(query="^BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED").kill()'); -\copy test_table FROM STDIN DELIMITER ',' +\copy test_table FROM PROGRAM 'true' DELIMITER ',' SELECT citus.mitmproxy('conn.allow()'); SELECT * FROM unhealthy_shard_count; SELECT count(*) FROM test_table; -- cancel as soon as the coordinator sends begin SELECT citus.mitmproxy('conn.onQuery(query="^BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED").cancel(' || pg_backend_pid() || ')'); -\copy test_table FROM STDIN DELIMITER ',' +\copy test_table FROM PROGRAM 'true' DELIMITER ',' SELECT citus.mitmproxy('conn.allow()'); SELECT * FROM unhealthy_shard_count; SELECT count(*) FROM test_table;