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

Allow CONNECT engine to read and write to FoxPro DBF/CDX/FPT files

Details

    Description

      I tried to create a CONNECT table using the following command –

      create table cust engine=CONNECT table_type=DBF file_name='test.dbf';

      I got an error –

      Error Code: 1105. Unsupported DBF type M

      I'm assuming DBF type M means that there are Memo fields in use? Or perhaps that means something else.

      Anyway, if it's a reasonable request, support for FoxPro tables including memo field support (FPT files) and CDX indexes would be extremely helpful.

      Attachments

        1. M_PROD.CDX
          258 kB
          Carlos Manuel Escalona Villeda
        2. M_PROD.DBF
          4.63 MB
          Carlos Manuel Escalona Villeda
        3. M_PROD.FPT
          52 kB
          Carlos Manuel Escalona Villeda

        Activity

          I attached a DBF with memofile to test

          paynalton Carlos Manuel Escalona Villeda added a comment - I attached a DBF with memofile to test

          M is for unicode string (memo), byte string (picture or object) or None. In the dbf file, it is a10 digits (bytes) representing a .DBT block number. The number is stored as a string, right justified and padded with blanks.
          This was not supported but it is easy to add it. I did it and the column is displayed as a number.
          However, I have no idea of what the FTP and CDX binary files are used for.
          This is not a real support but it makes possible to use the table.
          NOTE: Apparently, FOXPRO adds some sort of padding to the records. The result is that the default LRECL calculated by CONNECT does not match the LRECL stored in the DBF file header. This is checked by CONNECT that issues an error message. To prevent this, when creating the table, specify the LRECL option or add:

           option_list='accept=YES'
          

          bertrandop Olivier Bertrand added a comment - M is for unicode string (memo), byte string (picture or object) or None. In the dbf file, it is a10 digits (bytes) representing a .DBT block number. The number is stored as a string, right justified and padded with blanks. This was not supported but it is easy to add it. I did it and the column is displayed as a number. However, I have no idea of what the FTP and CDX binary files are used for. This is not a real support but it makes possible to use the table. NOTE : Apparently, FOXPRO adds some sort of padding to the records. The result is that the default LRECL calculated by CONNECT does not match the LRECL stored in the DBF file header. This is checked by CONNECT that issues an error message. To prevent this, when creating the table, specify the LRECL option or add: option_list='accept=YES'

          The CDX file is an index, and the FPT file is the storage to memo field data.

          paynalton Carlos Manuel Escalona Villeda added a comment - The CDX file is an index, and the FPT file is the storage to memo field data.
          bertrandop Olivier Bertrand added a comment - - edited

          The M column type is now accepted but just returns the .DBT block number.

          Note: it is possibly not included in version 10.1.21 that was announced just the day after I pushed the fix.

          bertrandop Olivier Bertrand added a comment - - edited The M column type is now accepted but just returns the .DBT block number. Note : it is possibly not included in version 10.1.21 that was announced just the day after I pushed the fix.

          People

            bertrandop Olivier Bertrand
            bjquinn BJ Quinn
            Votes:
            1 Vote for this issue
            Watchers:
            4 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.