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

server collation in initial handshake packet doesn't change after changing character_set_server

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 5.5, 10.0, 10.1, 10.2, 10.3
    • 10.4
    • Server
    • None

    Description

      After setting the global variable character_set_server to utf16, the server collation in initial handshake packet (sent from server to client) is sending old collation.

      static int test_server_language(MYSQL *unused __attribute__((unused)))
      {
        MYSQL *mysql= mysql_init(NULL);
        MYSQL_RES *res;
        MYSQL_ROW row;
       
        if (!mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, 0))
        {
          diag("Connection failed. Error: %s", mysql_error(mysql));
          mysql_close(mysql);
          return FAIL;
        }
       
        mysql_query(mysql, "SET global character_set_server=utf16");
       
        mysql_query(mysql, "SELECT @@character_set_server");
       
        res= mysql_store_result(mysql);
        row= mysql_fetch_row(res);
       
        diag("character_set_server=%s", row[0]);
        diag("server collation in initial handshake packet=%d", mysql->server_language);
        mysql_free_result(res);
       
        mysql_close(mysql);
       
        diag("-- New connection --");
        mysql= mysql_init(NULL);
        if (!mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, 0))
        {
          diag("Connection failed. Error: %s", mysql_error(mysql));
          mysql_close(mysql);
          return FAIL;
        }
       
        mysql_query(mysql, "SELECT @@character_set_server");
       
        res= mysql_store_result(mysql);
        row= mysql_fetch_row(res);
       
        diag("character_set_server=%s", row[0]);
        diag("server collation in initial handshake packet=%d", mysql->server_language);
        mysql_free_result(res);
       
        mysql_close(mysql);
        return OK;
      }
      

      Output (Server was started with character_set_server=latin1):

      # character_set_server=latin1
      # server collation in initial handshake packet=8
      # -- New connection --
      # character_set_server=utf16
      # server collation in initial handshake packet=8
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            georg Georg Richter
            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.