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

parser to utf8mb3 conversion hides errors

    XMLWordPrintable

Details

    Description

      This shows in a test case for MDEV-22558

      set names utf8mb3;
      --error ER_INVALID_CHARACTER_STRING
      create table t1 (x int comment 'a’');
      set names utf8mb4
      --echo # no error ???
      create table t1 (x int comment 'a’');
      

      In the second case the comment is valid 'a?' string.

      This happens because all metadata are internally always utf8mb3, stored as utf8mb3, shown in INFORMATION_SCHEMA as utf8mb3.

      So if the connection charset is utf8mb3, the parser gives it to the server as is. Later validate_comment_length() validates that the comment is well formed and finds that it is not.

      If the connection charset is not utf8mb3, the parser uses TEXT_STRING_sys rule that converts the string to utf8mb3 with THD::convert_string() and the latter ignores charset conversion errors. The server and validate_comment_length() gets a perfectly well-formed string "a?".

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.