Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-22561

Unable to access DBF inside a ZIP archiveConnect engine Zip

Details

    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.

      Attachments

        Activity

          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.

          bertrandop Olivier Bertrand added a comment - 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.

          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.

          bertrandop Olivier Bertrand added a comment - 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.

          People

            bertrandop Olivier Bertrand
            bjb Jean-Baptiste BUGEAUD
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.