You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two issues here; one is easy to reproduce the other one I cannot yet reproduce in a smaller setting.
Create a file /tmp/nullcheck containing:
'null'
create table testnull (test varchar(10));
copy 1 records into testnull from '/tmp/nullcheck' USING DELIMITERS '\n', '''';
select * from testnull will give now an empty value.
While: insert into testnull values('null'); will result into the string 'null' inside the table.
The actual observation was that anything starting with 'nu...' would become a null variable; but outside the OSM insert script I cannot reproduce this behavior. The expected behavior would be that 'null' would be just the string. While the quoteless variant would get into NULL.
COPY 1 RECORDS INTO node_tags from '/tmp/nulltest' USING DELIMITERS ',', '\n', '''';
sql>select * from node_tags;
+------+------+---+
| node | k | v |
+======+======+===+
| 1 | test | n |
: : : u :
: : : l :
: : : l :
+------+------+---+
1 tuple
This issue seems to pop up again in Jul2015 (tested on 11.21.6):
$ cat temp.data
CREATE TABLE x (a CLOB);
COPY 3 RECORDS INTO x FROM STDIN USING DELIMITERS ',', '\n', ''';
'null'
'aap'
'beer'
SELECT * FROM x WHERE a IS NULL;
DROP TABLE x;
Date: 2009-03-22 08:35:41 +0100
From: @skinkie
To: @njnes
Version: 11.21.5 (Jul2015)
CC: @swingbit
Last updated: 2016-01-15 11:38:07 +0100
Comment 11335
Date: 2009-03-22 20:35:41 +0100
From: @skinkie
There are two issues here; one is easy to reproduce the other one I cannot yet reproduce in a smaller setting.
Create a file /tmp/nullcheck containing:
'null'
create table testnull (test varchar(10));
copy 1 records into testnull from '/tmp/nullcheck' USING DELIMITERS '\n', '''';
select * from testnull will give now an empty value.
While: insert into testnull values('null'); will result into the string 'null' inside the table.
The actual observation was that anything starting with 'nu...' would become a null variable; but outside the OSM insert script I cannot reproduce this behavior. The expected behavior would be that 'null' would be just the string. While the quoteless variant would get into NULL.
Comment 11336
Date: 2009-03-22 22:38:35 +0100
From: @skinkie
Other (worse) example now works too:
CREATE TABLE "sys"."node_tags" (
"node" int,
"k" varchar(255),
"v" varchar(1024)
);
/tmp/nulltest:
1, 'test', 'Nullen RA'
COPY 1 RECORDS INTO node_tags from '/tmp/nulltest' USING DELIMITERS ',', '\n', '''';
sql>select * from node_tags;
+------+------+---+
| node | k | v |
+======+======+===+
| 1 | test | n |
: : : u :
: : : l :
: : : l :
+------+------+---+
1 tuple
Comment 11337
Date: 2009-04-01 17:35:35 +0200
From: @sjoerdmullender
This was fixed.
I added a test sql/src/test/BugTracker-2009/Tests/nullstr.SF-2704016.sql.
Comment 11338
Date: 2010-05-04 09:32:09 +0200
From: Pseudo user for Sourceforge import <>
This bug was previously known as tracker item 2704016 at http://sourceforge.net/support/tracker.php?aid=2704016
Comment 21470
Date: 2015-11-06 11:38:10 +0100
From: @swingbit
This issue seems to pop up again in Jul2015 (tested on 11.21.6):
$ cat temp.data
CREATE TABLE x (a CLOB);
COPY 3 RECORDS INTO x FROM STDIN USING DELIMITERS ',', '\n', ''';
'null'
'aap'
'beer'
SELECT * FROM x WHERE a IS NULL;
DROP TABLE x;
$ mclient -lsql -p50110 test001 < temp.data
operation successful
3 affected rows
+------+
| a |
+======+
| null |
+------+
1 tuple
operation successful
Comment 21618
Date: 2015-11-28 17:31:21 +0100
From: MonetDB Mercurial Repository <>
Changeset 366cebe9e451 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.
For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=366cebe9e451
Changeset description:
Comment 21619
Date: 2015-11-28 17:31:43 +0100
From: @njnes
allow for null's in copy into strings
The text was updated successfully, but these errors were encountered: