Bug #22035 LOAD DATA INFILE "no-such-file" returns a general error
Submitted: 6 Sep 2006 1:39 Modified: 6 Sep 2006 12:23
Reporter: Marc Alff
Status: Verified
Category:Server: Errors Severity:S4 (Feature request)
Version:5.0, 5.1 OS:Linux (Linux)
Assigned to: Target Version:
Triage: Triaged: D5 (Feature request)

[6 Sep 2006 1:39] Marc Alff
Description:
LOAD DATA INFILE "no-such-file" into table ...
fails as expected.

LOAD DATA INFILE "no-such-dir/no-such-file" into table ...
fails as expected.

However, the error code reported is 29 and 13 respectively (on linux),
and the message is :

load data infile "no-such-file" into table t1 (a);
ERROR HY000: File '.../no-such-file' not found (Errcode: 2)
load data infile "no-such-dir/no-such-file" into table t1 (a);
ERROR HY000: Can't get stat of '.../no-such-dir/no-such-file' (Errcode: 2)

See man 2 stat (Linux)

Expected result :
- return an error defined sql_state.h, not "General error" HY000
- return an error that is not platform dependent, so it's trappable.
- document the returned error for these cases

How to repeat:
See above

Suggested fix:
See above
[6 Sep 2006 11:59] Sveta Smirnova
Thank you for the reasonable feature request.

Verified as described on Linux using last BK sources.