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

Client allows to set character set to utf32 and crashes on the next command

    XMLWordPrintable

Details

    Description

      For some character sets, SET NAMES <charset> is forbidden.
      However, the client still allows \C <charset> without a complaint, and the next command causes a SIGSEGV.

      --exec $MYSQL test -e '\C utf32 ; SELECT 1'
      --echo # Success
      

      10.5 3d4174762563afcc2532e86c5a6c5686daa52fad

      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x000055609b217f79 in add_line (buffer=..., line=0x55609cb86408 "\\C utf32 ; SELECT 1", line_length=19, in_string=0x7fff6110f026 "", ml_comment=0x7fff6110f027, truncated=false) at /data/bld/10.5-debug/client/mysql.cc:2388
      2388	      if (my_isspace(charset_info,inchar) && (out == line) &&
       
      Thread 1 (Thread 0x7f23738a0740 (LWP 2705702)):
      #0  0x000055609b217f79 in add_line (buffer=..., line=0x55609cb86408 "\\C utf32 ; SELECT 1", line_length=19, in_string=0x7fff6110f026 "", ml_comment=0x7fff6110f027, truncated=false) at /10.5/client/mysql.cc:2388
      #1  0x000055609b2177c4 in read_and_execute (interactive=false) at /10.5/client/mysql.cc:2210
      #2  0x000055609b216172 in main (argc=12, argv=0x55609cb86960) at /10.5/client/mysql.cc:1286
      

      Reproducible with all existing versions, and (at least) with MySQL 8.0.35.

      Attachments

        Activity

          People

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