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

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

Details

    Description

      Bug MDEV-11343 still exist in 5.5.52 and 5.5.53

      Same steps to reproduce

      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: ''
      

      Attachments

        Issue Links

          Activity

            I'm somewhat afraid of backporting it to 5.5.

            The LOAD code has always been very fragile. Fixing one problem often introduced another problem. So in 10.2 we completely rewrote it. Hopefully starting from 10.2 it will work fine.

            When we backported an extraction of the 10.2 patch to 10.0/10.1, it was a partial backport only, so some unexpected side effects are possible when the old code fragments are involved. Backporting it to 5.5 makes the things even more dangerous.

            bar Alexander Barkov added a comment - I'm somewhat afraid of backporting it to 5.5. The LOAD code has always been very fragile. Fixing one problem often introduced another problem. So in 10.2 we completely rewrote it. Hopefully starting from 10.2 it will work fine. When we backported an extraction of the 10.2 patch to 10.0/10.1, it was a partial backport only, so some unexpected side effects are possible when the old code fragments are involved. Backporting it to 5.5 makes the things even more dangerous.

            dangerous to backport to 5.5.

            bar Alexander Barkov added a comment - dangerous to backport to 5.5.

            still need to test if it's fixed by the latest 5.5 merge and add a test case

            serg Sergei Golubchik added a comment - still need to test if it's fixed by the latest 5.5 merge and add a test case
            bar Alexander Barkov added a comment - - edited

            The patch c3cf7f47f0f4a1ec314001aaf0c3d9c1c1f62097 fixed this problem.
            Added a test case into 5.5.

            bar Alexander Barkov added a comment - - edited The patch c3cf7f47f0f4a1ec314001aaf0c3d9c1c1f62097 fixed this problem. Added a test case into 5.5.

            People

              serg Sergei Golubchik
              Richard Richard Stracke
              Votes:
              1 Vote for this issue
              Watchers:
              6 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.