Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit167bc6c

Browse files
author
Neil Conway
committed
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 testfor anyway.) From Andrew Dunstan.
1 parent3b6073d commit167bc6c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎src/test/regress/expected/copy2.out

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ COPY y TO stdout WITH CSV FORCE QUOTE col2 ESCAPE '\\';
191191
"Jackson, Sam","\\h"
192192
"It is \"perfect\".",""
193193
"",
194+
--test that we read consecutive LFs properly
195+
CREATE TEMP TABLE testnl (a int, b text, c int);
196+
COPY testnl FROM stdin CSV;
194197
DROP TABLE x, y;
195198
DROP FUNCTION fn_x_before();
196199
DROP FUNCTION fn_x_after();

‎src/test/regress/sql/copy2.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ COPY y TO stdout WITH CSV;
129129
COPY y TO stdout WITH CSV QUOTE'''' DELIMITER'|';
130130
COPY y TO stdout WITH CSV FORCE QUOTE col2 ESCAPE'\\';
131131

132+
--test that we read consecutive LFs properly
133+
134+
CREATE TEMP TABLE testnl (aint, btext, cint);
135+
136+
COPY testnlFROM stdin CSV;
137+
1,"a field with two LFs
138+
139+
inside",2
140+
\.
141+
142+
132143
DROPTABLE x, y;
133144
DROPFUNCTION fn_x_before();
134145
DROPFUNCTION fn_x_after();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp