postgres.git / summary / log / commit / refs
commit 134dc506ee9bb4698f203236b0e35cb371380eda
Author: Michael Paquier <michael@paquier.xyz>
Date: Fri Nov 06 01:45:11 2026 +0000
First released in: 17.12, 18.7, 19.0
Revert "Fix use-after-free in COPY (ON_ERROR)"
This reverts commit 23e2a332dd24. It looks like it is going to need a
little bit more work, and v19 RC2 is close by.
Backpatch-through: 17
src/backend/commands/copyfromparse.c | 4 ----
src/test/regress/expected/copy2.out | 4 ----
src/test/regress/sql/copy2.sql | 6 ------
3 files changed, 14 deletions(-)
diff --git a/src/backend/commands/copyfromparse.c b/src/backend/commands/copyfromparse.c
index 9bc9fdffdbf..97a4c387a30 100644
--- a/src/backend/commands/copyfromparse.c
+++ b/src/backend/commands/copyfromparse.c
@@ -873,10 +873,6 @@ NextCopyFrom(CopyFromState cstate, ExprContext *econtext,
MemSet(nulls, true, num_phys_attrs * sizeof(bool));
MemSet(cstate->defaults, false, num_phys_attrs * sizeof(bool));
- /* Clear the current attribute for error messages. */
- cstate->cur_attname = NULL;
- cstate->cur_attval = NULL;
-
if (!cstate->opts.binary)
{
char **field_strings;
diff --git a/src/test/regress/expected/copy2.out b/src/test/regress/expected/copy2.out
index 1faa4506362..859f40b3fc0 100644
--- a/src/test/regress/expected/copy2.out
+++ b/src/test/regress/expected/copy2.out
@@ -802,10 +802,6 @@ CONTEXT: COPY hard_err, line 1, column foo: "1"
COPY check_ign_err FROM STDIN WITH (on_error ignore);
ERROR: missing data for column "k"
CONTEXT: COPY check_ign_err, line 1: "1 {1}"
--- test extra data after a skipped row: should fail, reporting the line
-COPY check_ign_err FROM STDIN WITH (on_error ignore);
-ERROR: extra data after last expected column
-CONTEXT: COPY check_ign_err, line 2: "2 {2} 2 extra"
-- test extra data: should fail
COPY check_ign_err FROM STDIN WITH (on_error ignore);
ERROR: extra data after last expected column
diff --git a/src/test/regress/sql/copy2.sql b/src/test/regress/sql/copy2.sql
index d5c7f120dff..a17f407e02c 100644
--- a/src/test/regress/sql/copy2.sql
+++ b/src/test/regress/sql/copy2.sql
@@ -602,12 +602,6 @@ COPY check_ign_err FROM STDIN WITH (on_error ignore);
1 {1}
\.
--- test extra data after a skipped row: should fail, reporting the line
-COPY check_ign_err FROM STDIN WITH (on_error ignore);
-1 {1} a
-2 {2} 2 extra
-\.
-
-- test extra data: should fail
COPY check_ign_err FROM STDIN WITH (on_error ignore);
1 {1} 3 abc
[parent: 5b80ddaf6902]