Bugs item #1842550, was opened at 2007-12-02 05:30
Message generated for change (Comment added) made by nielsnes
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1842550&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: mharrison (matt_harrison)
Assigned to: Niels Nes (nielsnes)
Summary: Better error reports on bulk load (include line num)...

Initial Comment:
The following bulk load fails

CREATE TABLE bulk (
        num SMALLINT NOT NULL,
        name VARCHAR(30) NOT NULL,
        PRIMARY KEY (num)
);

/tmp/bulk2.csv
5536|'5536'
53605|'53605'

COPY 2 RECORDS INTO bulk FROM '/tmp/bulk2.csv' USING DELIMITERS '|', '\n';

Here's the error message:
!SQLException:assert:INSERT INTO: NOT NULL constraint violated for column 
bulk.num


I have 2 suggestions:

 1. If there is a cause of the constraint failure, print it.  In this case, the 
PK is a smallint and the value exceeds 32767.  When I try and manually enter 
that line, I get that error.

INSERT into bulk values(32768,'53605');
!SQLException:convert:value (32768) exceeds limits of type sht

Is it possible to bubble this error up?

 2. Please include a line number where the failure occurred.  For a 2 line file 
it doesn't matter but when you have millions of entries, doing a binary search 
to find the failing entry gets annoying.

thanks much

-matt

----------------------------------------------------------------------

>Comment By: Niels Nes (nielsnes)
Date: 2007-12-02 07:17

Message:
Logged In: YES 
user_id=43556
Originator: NO

Added a test for this bug in 
src/test/BugTracker/Tests/copy_overflow_null_bug.SF-1842550.sql

----------------------------------------------------------------------

Comment By: Niels Nes (nielsnes)
Date: 2007-12-02 06:14

Message:
Logged In: YES 
user_id=43556
Originator: NO

This is more a bug as it casts the overflowing value into a null, which
isn't correct.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1842550&group_id=56967

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to