Fix syntax error combined with NULL string and CRLF in COPY text mode
In a copy statement, while processing NULL string at the last column, GPDB assumed the length of EOL was 1, which is wrong when it's a DOS format file ends line with '\r\n'. For example: ------------------------------------------------------------ /tmp/file.txt: abc|\N\r\n cde|123\r\n test=# CREATE TABLE tbl (c1 text, c2 int); CREATE TABLE test=# COPY tbl FROM '/tmp/file.txt' WITH DELIMITER AS '|' NEWLINE AS 'CRLF'; ERROR: invalid input syntax for integer: "N" ------------------------------------------------------------ This commit fixes it. Signed-off-by: NAdam Lee <ali@pivotal.io> Signed-off-by: NPeifeng Qiu <pqiu@pivotal.io>
Showing
想要评论请 注册 或 登录