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

Setting client character set after connection has no effect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.2.1
    • Component/s: mariadbbackend
    • Labels:
      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

            Assignee:
            johan.wikman Johan Wikman
            Reporter:
            shadowhand Woody Gilk
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: