aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2005-05-13 06:33:40 +0000
committerNeil Conway <neilc@samurai.com>2005-05-13 06:33:40 +0000
commit167bc6c6218c76369cfcf10686a8c241a6fde8c1 (patch)
tree9d614d133760d1b75cbcb70c57bf27b71e3d1fa1 /src
parent3b6073de7138ca948c07aec397ba65e147bdec6b (diff)
downloadpostgresql-167bc6c6218c76369cfcf10686a8c241a6fde8c1.tar.gz
postgresql-167bc6c6218c76369cfcf10686a8c241a6fde8c1.zip
Add regression test for consecutive newlines in COPY CSV mode. (There is
no bug related to this functionality in HEAD, but it's worth adding a test for anyway.) From Andrew Dunstan.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/copy2.out3
-rw-r--r--src/test/regress/sql/copy2.sql11
2 files changed, 14 insertions, 0 deletions
diff --git a/src/test/regress/expected/copy2.out b/src/test/regress/expected/copy2.out
index 6a4769adac1..40dd7f24af2 100644
--- a/src/test/regress/expected/copy2.out
+++ b/src/test/regress/expected/copy2.out
@@ -191,6 +191,9 @@ COPY y TO stdout WITH CSV FORCE QUOTE col2 ESCAPE '\\';
"Jackson, Sam","\\h"
"It is \"perfect\"."," "
"",
+--test that we read consecutive LFs properly
+CREATE TEMP TABLE testnl (a int, b text, c int);
+COPY testnl 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 78bbf4182e5..eb1a69c0955 100644
--- a/src/test/regress/sql/copy2.sql
+++ b/src/test/regress/sql/copy2.sql
@@ -129,6 +129,17 @@ COPY y TO stdout WITH CSV;
COPY y TO stdout WITH CSV QUOTE '''' DELIMITER '|';
COPY y TO stdout WITH CSV FORCE QUOTE col2 ESCAPE '\\';
+--test that we read consecutive LFs properly
+
+CREATE TEMP TABLE testnl (a int, b text, c int);
+
+COPY testnl FROM stdin CSV;
+1,"a field with two LFs
+
+inside",2
+\.
+
+
DROP TABLE x, y;
DROP FUNCTION fn_x_before();
DROP FUNCTION fn_x_after();