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

SELECT INTO OUTFILE/LOAD DATA INFILE - option to encode binary data as hex of base64

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 12.1
    • None
    • None

    Description

      Not only binary data in tab-separated files look bad in any editor,
      it is hardly editable, and this is hard to parse it for the LOAD DATA itself

      One possible idea is to add escaping to the field, e.g \X for hex and \B for base64, this makes output tab-separated file more self-describing.

      Or, SELECT INTO OUTFILE could rely on result set metadata like command-line client or mariadb-dump does, and LOAD DATA INFILE with hexblob option can rely on DDL info to unhex the field

      Otherwise, it should be possibly to explicitly provide field names of hex/base64 encoded fields (although, not quite as user-friendly)

      MySQL Shell dump-utilities do that (base64), and store the base64-ed fields in the metadata file, but it would be better to have it implemented in server itself.

      Attachments

        Issue Links

          Activity

            wlad Vladislav Vaintroub created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            wlad Vladislav Vaintroub made changes -
            Description
            Not only binary data in tab-separated files look bad in any editor,
            it is hardly editable, and this is hard to parse it for the LOAD DATA itself

            One possible idea is to add escaping to the field, e.g \X for hex and \B for base64.
            Otherwise, it should be possibly to explicitely provide field names of hex/base64 encoded fields (although, not quite as user-friendly)

            Not only binary data in tab-separated files look bad in any editor,
            it is hardly editable, and this is hard to parse it for the LOAD DATA itself

            One possible idea is to add escaping to the field, e.g \X for hex and \B for base64, this makes output tab-separated file more self-describing.

            Or, SELECT INTO OUTFILE could rely on result set metadata like command-line client or mariadb-dump does, and LOAD DATA INFILE with hexblob option can rely on DDL info to unhex the field

            Otherwise, it should be possibly to explicitly provide field names of hex/base64 encoded fields (although, not quite as user-friendly)
            wlad Vladislav Vaintroub made changes -
            wlad Vladislav Vaintroub made changes -
            Description Not only binary data in tab-separated files look bad in any editor,
            it is hardly editable, and this is hard to parse it for the LOAD DATA itself

            One possible idea is to add escaping to the field, e.g \X for hex and \B for base64, this makes output tab-separated file more self-describing.

            Or, SELECT INTO OUTFILE could rely on result set metadata like command-line client or mariadb-dump does, and LOAD DATA INFILE with hexblob option can rely on DDL info to unhex the field

            Otherwise, it should be possibly to explicitly provide field names of hex/base64 encoded fields (although, not quite as user-friendly)
            Not only binary data in tab-separated files look bad in any editor,
            it is hardly editable, and this is hard to parse it for the LOAD DATA itself

            One possible idea is to add escaping to the field, e.g \X for hex and \B for base64, this makes output tab-separated file more self-describing.

            Or, SELECT INTO OUTFILE could rely on result set metadata like command-line client or mariadb-dump does, and LOAD DATA INFILE with hexblob option can rely on DDL info to unhex the field

            Otherwise, it should be possibly to explicitly provide field names of hex/base64 encoded fields (although, not quite as user-friendly)

            MySQL Shell dump-utilities do that (base64), and store the base64-ed fields in the metadata file, but it would be better to have it implemented in server itself.
            wlad Vladislav Vaintroub made changes -
            Assignee Alexander Barkov [ bar ]
            serg Sergei Golubchik made changes -
            Fix Version/s 11.9 [ 29945 ]
            Fix Version/s 11.8 [ 29921 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 12.1 [ 29992 ]
            Fix Version/s 12.0 [ 29945 ]

            People

              bar Alexander Barkov
              wlad Vladislav Vaintroub
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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