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.
This commit is contained in:
parent
3b6073de71
commit
167bc6c621
@ -191,6 +191,9 @@ COPY y TO stdout WITH CSV FORCE QUOTE col2 ESCAPE '\\';
|
|||||||
"Jackson, Sam","\\h"
|
"Jackson, Sam","\\h"
|
||||||
"It is \"perfect\"."," "
|
"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 TABLE x, y;
|
||||||
DROP FUNCTION fn_x_before();
|
DROP FUNCTION fn_x_before();
|
||||||
DROP FUNCTION fn_x_after();
|
DROP FUNCTION fn_x_after();
|
||||||
|
@ -129,6 +129,17 @@ COPY y TO stdout WITH CSV;
|
|||||||
COPY y TO stdout WITH CSV QUOTE '''' DELIMITER '|';
|
COPY y TO stdout WITH CSV QUOTE '''' DELIMITER '|';
|
||||||
COPY y TO stdout WITH CSV FORCE QUOTE col2 ESCAPE '\\';
|
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 TABLE x, y;
|
||||||
DROP FUNCTION fn_x_before();
|
DROP FUNCTION fn_x_before();
|
||||||
DROP FUNCTION fn_x_after();
|
DROP FUNCTION fn_x_after();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user