Bug 6532 - copy into ignore null as directive if first column doesn't come from file
Summary: copy into ignore null as directive if first column doesn't come from file
Alias: None
Product: SQL
Classification: Unclassified
Component: all (show other bugs)
Version: 11.27.11 (Jul2017-SP3)
Hardware: Other Linux
: Normal normal
Assignee: SQL devs
Depends on:
Reported: 2018-02-04 18:46 CET by Sjoerd Mullender
Modified: 2018-03-29 15:39 CEST (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Sjoerd Mullender cwiconfidential 2018-02-04 18:46:54 CET

Comment 1 Sjoerd Mullender cwiconfidential 2018-02-04 18:53:10 CET
The following creates a table and insert one row where the first column is filled in using the default value (a sequence) and the other columns come from a file.  When doing this, the NULL AS blurb gets ignored.

create table t (id int auto_increment, a clob, b clob);
copy 1 records into t (a, b) from stdin (id, a, b) using delimiters ',','\n','"' null as '';

select * from t;
this now results in a row with values id=1, a='', b='' instead of id=1,a=NULL,b=NULL.
Comment 2 Sjoerd Mullender cwiconfidential 2018-02-04 18:54:37 CET
The first column must be in the file, but it must be ignored by the COPY IN.
Comment 3 MonetDB Mercurial Repository cwiconfidential 2018-02-04 22:36:20 CET
Changeset e2fda4b58c9f, made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.

For complete details, see https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e2fda4b58c9f

Changeset description:

	Don't skip checking for nullstr when skipping first column.
	This fixes bug 6532.
Comment 4 Sjoerd Mullender cwiconfidential 2018-03-29 15:39:23 CEST
The Mar2018 version has been released.