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

GBK: client gets stuck on string input for '\{BF5C}\\'

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 5.3.12, 5.5.39, 10.0.13
    • 5.5(EOL)
    • None
    • None

    Description

      Multi-byte GBK characters with 0x5C do not work well in
      combination with surrounding backslash escapes.

      To repeat the bug, run a gnome-terminal session and set
      its character set to GBK:

      Terminal -> Character Coding -> Simplified Chinese (GBK)

      Run this command:

      LANG=zh_CN.gbk mysql --default-character-set=gbk test

      and execute this SQL query:

      SELECT HEX('\縗\\');

      The client gets stuck in the string input state, waiting for another closing quote:

      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 18
      Server version: 10.0.14-MariaDB-debug Source distribution
       
      Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      MariaDB [test]> SELECT HEX('\縗\\');
          '> 

      This is wrong. The expected behaviour would be to accept the entered query and return 'BF5C5C' as a result.

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            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.