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

COPY [xxx RECORDS] INTO foo FROM STDIN ... doesn't work without specifying nr of to be copied records #6669

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working normal SQL

Comments

@monetdb-team
Copy link

Date: 2018-12-15 09:41:53 +0100
From: @aris-koning
To: SQL devs <>
Version: 11.31.11 (Aug2018-SP1)
CC: @njnes, @sstalin

Last updated: 2019-04-30 12:36:04 +0200

Comment 26730

Date: 2018-12-15 09:41:53 +0100
From: @aris-koning

User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0
Build Identifier:

When copying from stdin the user seems to be obliged to provide the number of records to be inserted. Which could be fine because I can imagine that it is otherwise hard to know when the last record is seen when reading from stdin. However this isn't immediately clear from the documentation and error message.

Reproducible: Always

Steps to Reproduce:

1.create table if not exists foo (bar int, baz varchar(10));
2.copy into foo from stdin delimiters ',', '\n', '''';
3.5,'aa5aa'
4.0,'aa0aa'
5.

Actual Results:

Failed to import table 'foo', Column value 1 missing

Expected Results:

Failed to import table 'foo', nr of records have to be specified when copying from standard input.

If it is warranted that COPY INTO fails in this case, please also update the documentation to make that point clear.

Comment 26733

Date: 2018-12-19 11:02:20 +0100
From: @njnes

empty line used to also mark the end, that seems gone. Probably better
to adapt the documentation.

Comment 26742

Date: 2018-12-21 10:03:14 +0100
From: MonetDB Mercurial Repository <>

Changeset d5b35d896228 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d5b35d896228

Changeset description:

COPY INTO ... FROM STDIN stops at empty line if no RECORDS count specified.
This fixes bug #6669.
Note that this change does not affect COPY INTO from an actual file,
nor does it affect COPY INTO FROM STDIN when a count of the number of
records to be ingested is specified.

Comment 26744

Date: 2018-12-21 10:39:08 +0100
From: @aris-koning

Changeset looks fine to me, if the documentation is updated accordingly I would consider this issue fixed.

Comment 26775

Date: 2019-01-04 10:00:13 +0100
From: @sjoerdmullender

(In reply to aris from comment 3)

Changeset looks fine to me, if the documentation is updated accordingly I
would consider this issue fixed.

Some text has been added to [1].

[1] https://www.monetdb.org/Documentation/Manuals/SQLreference/CopyInto

Comment 26778

Date: 2019-01-04 14:58:35 +0100
From: @aris-koning

Looks very clear to me. I vote for marking the report as fixed and closing it.

Comment 26875

Date: 2019-02-05 13:04:59 +0100
From: @sstalin

This issue is still reproducible on MacOs Mojave.

Comment 26876

Date: 2019-02-05 16:09:47 +0100
From: MonetDB Mercurial Repository <>

Changeset a08ab79eedf3 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a08ab79eedf3

Changeset description:

Fix for bug #6669.
Also added test.

Comment 26877

Date: 2019-02-05 16:10:25 +0100
From: @sjoerdmullender

Fixed properly this time.

@monetdb-team monetdb-team added bug Something isn't working normal SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants