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

LOAD DATA INFILE fails to load data with an escape character followed by a multi-byte character

    XMLWordPrintable

Details

    Description

      I create a file with a backslash followed by a multi-byte utf8 character:

      echo "\ä" >/tmp/test.txt
      

      Now I try to load this file into a table:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8);
      LOAD DATA INFILE '/tmp/test.txt' INTO TABLE t1 CHARACTER SET utf8;
      

      It fails with this error:

      ERROR 1300 (HY000): Invalid utf8 character string: ''
      

      Looks wrong. The expected behaviour is to put the character 'ä' into the table.

      The problem is NOT repeatable in 5.5.
      The problem is repeatable in 10.0.
      The problem is repeatable in 10.1.
      The problem is NOT repeatable in 10.2.

      It seems the problem was introduced when we merged this change from MySQL:

      commit 9f7288e2e0179db478d20c74f57b5c7d6c95f793
      Author: Thayumanavar S <thayumanavar.x.sachithanantha@oracle.com>
      Date:   Mon Jun 20 11:35:43 2016 +0530
       
          BUG#23080148 - BACKPORT BUG 14653594 AND BUG 20683959 TO MYSQL-5.5
          The bug asks for a backport of bug#1463594 and bug#20682959. This
          is required because of the fact that if replication is enabled, master
          transaction can commit whereas slave can't commit due to not exact
          'enviroment'. This manifestation is seen in bug#22024200.
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              3 Vote for this issue
              Watchers:
              9 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.