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 binary into fails with the wrong error message #3345

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

copy binary into fails with the wrong error message #3345

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

Comments

@monetdb-team
Copy link

Date: 2013-08-20 02:54:37 +0200
From: Tim H. <<monetdb.bug.reporter>>
To: SQL devs <>
Version: 11.15.7 (Feb2013-SP2)
CC: @mlkersten, @njnes, @drstmane

Last updated: 2013-09-27 13:47:16 +0200

Comment 19031

Date: 2013-08-20 02:54:37 +0200
From: Tim H. <<monetdb.bug.reporter>>

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

Suppose a "copy binary into <table_name> from ..." command is called such that <table_name> is a valid table and the from clause contains one bat file for every column. If the bat files have mismatched BATcount values, then the import fails with the wrong error message: "table <table_name> not found"

Reproducible: Always

Steps to Reproduce:

  1. Put the attached (to this bug) bat files in /path/to/bat/files/
  2. Execute SQL statement:
    create table bug (n_nationkey INTEGER,n_regionkey INTEGER);
  3. Execute SQL statement:
    copy binary into bug from '/path/to/bat/files/n_nationkey.sorted', '/path/to/bat/files/n_regionkey.sorted';

Actual Results:

table bug not found

Expected Results:

/path/to/bat/files/n_regionkey.sorted has an incompatible number of rows with the previously-processed file

The issue is in sql.c:mvc_bin_import_table_wrap

if (i!=(pci->retc + 2) && cnt != BATcount(c))
throw(SQL, "sql", "table %s not found", tname);

Comment 19032

Date: 2013-08-20 02:55:04 +0200
From: Tim H. <<monetdb.bug.reporter>>

Created attachment 221
Binary file referenced in the repro steps

Attached file: n_nationkey.sorted (application/octet-stream, 40 bytes)
Description: Binary file referenced in the repro steps

Comment 19033

Date: 2013-08-20 02:55:13 +0200
From: Tim H. <<monetdb.bug.reporter>>

Created attachment 222
Binary file referenced in the repro steps

Attached file: n_regionkey.sorted (application/octet-stream, 20 bytes)
Description: Binary file referenced in the repro steps

Comment 19034

Date: 2013-08-20 07:27:51 +0200
From: @mlkersten

This is a testcase and duplicate of bug #3325

Comment 19038

Date: 2013-08-20 22:50:39 +0200
From: Tim H. <<monetdb.bug.reporter>>

It's related, but not quite a duplicate of 3325. 3325 doesn't mention the incorrect error message, which is what this bug is about.

Comment 19057

Date: 2013-08-23 11:42:04 +0200
From: MonetDB Mercurial Repository <>

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

Changeset description:

fixed bug #3345

Comment 19058

Date: 2013-08-23 11:43:05 +0200
From: @njnes

proper error returned

Comment 19059

Date: 2013-08-23 12:42:07 +0200
From: @drstmane

Niels,

could you please also checkin the (correct/expected) stable output of the test for this bug?
sql/test/BugTracker-2013/Tests/binary_copy_into.Bug-3345.SQL.py

Thanks!
Stefan

Comment 19128

Date: 2013-09-04 23:30:55 +0200
From: MonetDB Mercurial Repository <>

Changeset 1609eae18f34 made by Stefan Manegold Stefan.Manegold@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=1609eae18f34

Changeset description:

binary_copy_into.Bug-3345: make test outout independent of local paths/directories

Comment 19134

Date: 2013-09-05 23:17:12 +0200
From: MonetDB Mercurial Repository <>

Changeset 02bf23417cee made by Stefan Manegold Stefan.Manegold@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=02bf23417cee

Changeset description:

binary_copy_into.Bug-3345: make test output independent of Windows vs Unix path separators
@monetdb-team monetdb-team added bug Something isn't working minor 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 minor SQL
Projects
None yet
Development

No branches or pull requests

2 participants