Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-372

Setting client character set after connection has no effect

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 1.2.0
    • 1.2.1
    • mariadbbackend
    • None

    Description

      As seen in this code the client settings are copied on connect and are not updated once the connection is made. The following PHP script can be used to show how this causes an unexpected state.

      This is very hard to reproduce, but we were able to do it by inserting ISO-8859-1 extended ASCII character (hex 96) into a table and then using this PHP script to show that the output is not the same as when the character set is "utf8".

      <?php
       
      $conn = new mysqli();
       
      $conn->real_connect($servername, $username, $password, $database);
       
      $conn->set_charset("utf8");
       
      $r = $conn->query("SELECT notes FROM users WHERE id=3;");
      $q = $r->fetch_assoc();
       
      print_r($q);

      I've also attached a screenshot of TCP debugging that shows the failure to set the character set after the fact when running the above script.

      Attachments

        Activity

          People

            johan.wikman Johan Wikman
            shadowhand Woody Gilk
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.