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 INTO table (column1, column2) got wrong result #3910

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

COPY INTO table (column1, column2) got wrong result #3910

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

Comments

@monetdb-team
Copy link

Date: 2016-01-25 16:30:33 +0100
From: Kaijiang <>
To: SQL devs <>
Version: 11.21.11 (Jul2015-SP1)
CC: @njnes

Last updated: 2016-03-25 09:59:40 +0100

Comment 21750

Date: 2016-01-25 16:30:33 +0100
From: Kaijiang <>

User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36
Build Identifier:

COPY INTO table (column1, column2) got wrong result (the column list is actually ignored!)

Reproducible: Always

Steps to Reproduce:

1.create table t (f1 int, f2 int);
2.create a text file, a.csv, with 1 line: 1\t2
3.COPY INTO t(f2,f1) from '/home/data/mdb_tmp/a.csv' USING DELIMITERS '\t';
4.SELECT * from t;

Actual Results:

Got:
+------+------+
| f1 | f2 |
+======+======+
| 1 | 2 |
+------+------+

Expected Results:

But the correct result should be:
+------+------+
| f1 | f2 |
+======+======+
| 2 | 1 |
+------+------+

Because I "COPY INTO t(f2,f1)", not "COPY INTO t(f1,f2)"!

Comment 21812

Date: 2016-02-23 08:26:12 +0100
From: MonetDB Mercurial Repository <>

Changeset e8c4edcbfabb 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=e8c4edcbfabb

Changeset description:

added tests for bug #3910 and 3912.

Fixed a problem with copy into with header information

Comment 21813

Date: 2016-02-23 08:26:20 +0100
From: @njnes

The column list after the table name isn't specifing the order (its simply (like insert into) the list of columns, which based on the name insert into that column). If you input file has a different order you should specify a header list, ie after the stdin or filename.

COPY 1 RECORDS INTO t(f1,f2) from STDIN (f2,f1) USING DELIMITERS ',';
1,2

Comment 21971

Date: 2016-03-25 09:59:40 +0100
From: @sjoerdmullender

Jul2015-SP3 has been released.

@monetdb-team monetdb-team added bug Something isn't working major 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 major SQL
Projects
None yet
Development

No branches or pull requests

2 participants