From c7fc2ccf63f054ac60bde739077fbcfb5f86de69 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 28 Dec 2005 05:38:27 +0000 Subject: Add regression tests for CSV and \., and add automatic quoting of a single column dump that has a \. value, so the load works properly. I also added documentation describing this issue. Backpatch to 8.1.X. --- src/test/regress/expected/copy2.out | 3 +++ src/test/regress/sql/copy2.sql | 10 ++++++++++ 2 files changed, 13 insertions(+) (limited to 'src/test') diff --git a/src/test/regress/expected/copy2.out b/src/test/regress/expected/copy2.out index 78f20605702..524e88cbae6 100644 --- a/src/test/regress/expected/copy2.out +++ b/src/test/regress/expected/copy2.out @@ -194,6 +194,9 @@ COPY y TO stdout WITH CSV FORCE QUOTE col2 ESCAPE E'\\'; --test that we read consecutive LFs properly CREATE TEMP TABLE testnl (a int, b text, c int); COPY testnl FROM stdin CSV; +-- test end of copy marker +CREATE TEMP TABLE testeoc (a text); +COPY testeoc FROM stdin CSV; DROP TABLE x, y; DROP FUNCTION fn_x_before(); DROP FUNCTION fn_x_after(); diff --git a/src/test/regress/sql/copy2.sql b/src/test/regress/sql/copy2.sql index add8214d19d..d962d2e048e 100644 --- a/src/test/regress/sql/copy2.sql +++ b/src/test/regress/sql/copy2.sql @@ -139,6 +139,16 @@ COPY testnl FROM stdin CSV; inside",2 \. +-- test end of copy marker +CREATE TEMP TABLE testeoc (a text); + +COPY testeoc FROM stdin CSV; +a\. +\.b +c\.d +"\." +\. + DROP TABLE x, y; DROP FUNCTION fn_x_before(); -- cgit v1.2.3