Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'null' from copy into gets wrong #2014

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

'null' from copy into gets wrong #2014

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Assignees

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

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:

allow null in strings, fixes bug #2014 (again).

Comment 21619

Date: 2015-11-28 17:31:43 +0100
From: @njnes

allow for null's in copy into strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants