[MDEV-22561] Unable to access DBF inside a ZIP archiveConnect engine Zip Created: 2020-05-14  Updated: 2020-07-14  Resolved: 2020-07-14

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Connect
Affects Version/s: 10.3
Fix Version/s: 10.2.33, 10.3.24, 10.4.14, 10.5.5

Type: Bug Priority: Major
Reporter: Jean-Baptiste BUGEAUD Assignee: Olivier Bertrand
Resolution: Fixed Votes: 0
Labels: connect-engine, dbf, zip
Environment:

Docker mariadb latest



 Description   

I am unable to get Connect to use a DBF inside a zip archive.

This fails with "#1105 - Cannot get columns from R_ACTE" :

CREATE TABLE R_ACTE engine=CONNECT table_type=DBF CHARSET=cp850 file_name="/tmp/CCAMArchiveLatest/CCAM_DBF.zip" zipped=1 option_list="Accept=1,Entry=R_ACTE.dbf";

As a workaround, unziping the archive in the same location and this would go thru :

CREATE TABLE R_ACTE engine=CONNECT table_type=DBF CHARSET=cp850 file_name="/tmp/CCAMArchiveLatest/R_ACTE.dbf" option_list="Accept=1";

File used is :
https://www.ameli.fr/fileadmin/user_upload/documents/CCAM06300_DBF_PART1.zip

The same issue happens for any DBF file from the same source. Those files are valid as per any other tools I've used to access them.

FYI, option Accept=1 is required to workaround another issue on using this kind of DBF.



 Comments   
Comment by Olivier Bertrand [ 2020-05-21 ]

It's not a real bug as the documentation does not specifies DBF files in the list of supported file types inside ZIP files.
If you think it is really important, I'll see if this can be implemented.

Comment by Olivier Bertrand [ 2020-07-14 ]

DBF files are added to types that can be handled from ZIP files. Discovery is available, meaning that DBF tables can be created without column specification or tables with catfunc=col can be used to get the column specification of a zipped DBF file.

Insert can also be used to zip a DBF file. Note that when inserting a file with the LOAD option a column description must be provided but is not used when zipping. This can be done with a fake column and another table table be created, eventually using discovery (no column), to read the zipped file. For instance:

create table mkzq (whatever int)
engine=connect table_type=DBF zipped=1
file_name='C:/Data/EAUX/dbf/CQUART.ZIP'
option_list='Load=C:/Data/EAUX/dbf/CQUART.DBF';

create table zquart
engine=connect table_type=DBF zipped=1
file_name='C:/Data/EAUX/dbf/CQUART.ZIP';

Note also that when inserting, the ENTRY name now defaults to the file name.

Generated at Thu Feb 08 09:15:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.