Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.10
-
None
-
CentOS 6.4 x86_64
Description
When adding a connect table from multiple files, it prints an error that it could be improved:
create table test (
|
Filename VARCHAR(100) NOT NULL default '' special=FILEID,
|
a varchar(25) not null default '',
|
b varchar(80) not null default '',
|
c varchar(10) not null default '',
|
d varchar(10) not null default '',
|
e varchar(10) not null default '',
|
f varchar(10) not null default '',
|
g varchar(10) not null default '',
|
h varchar(10) not null default '',
|
i varchar(10) not null default ''
|
)
|
engine=CONNECT
|
table_type=CSV
|
file_name='/tmp/FOLDER/PREC_*.txt'
|
multiple=1,
|
sep_char='|';
|
As soon I try to get some data, it prints an error with no clue to what relates to:
SELECT * FROM `test` LIMIT 1000;
|
/* SQL Error (1296): Got error 3 'Invalid null offset value for a CSV table' from CONNECT */
|
If I try do add the table with just one file, it works OK.
I suspect there's some file without data in proper format..
Could you add some more verbosity in ha_connect::GetTDB as to which filename relates to?
Best regards,
António Fernandes
This was a bug caused by the special column FILEID that was given an offset of 0 wrongly tested later. Now this test skips special columns.
Offset of CSV table columns are the rank of the corresponding field in the file starting at 1. For instance if you create a CSV table on the file:
id,errno,msg
25,215,error
and you are willing to skip the errno column, you should create it as:
Normally, CONNECT affects offsets by default starting at 1 and therefore an offset of 0 is invalid.