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

information_schema.processlist truncates queries with binary strings

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.16
    • Fix Version/s: 10.1.5
    • Component/s: Character Sets
    • Labels:
      None

      Description

      When I start a statement with binary data the column INFO of information_schema.processlist is truncated at the first byte > 128. show full processlist shows the full query in it's Info column.

      My test query is generated and run by this perl script:

      perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, 0..255);"
      

      While the sleep is still asleep, use

      select * from information_schema.processlist;
      show full processlist;
      

      or look at the info column specifically:

      select info from information_schema.processlist where state = 'User sleep';
      

      . With

      select char_length(info), length(info) from information_schema.processlist where state = 'User sleep';
      

      which results in

      154 154
      

      you can verify that the values are truncated inside the server, this is not a problem with the client connection or the client.

      For comparison use

      perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, map $_ % 128, 0..255);"
      

      and

      select char_length(info), length(info) from information_schema.processlist where state = 'User sleep';
      

      with the result

      291 291
      

      The character set settings are:

      'character_set_client', 'utf8'
      'character_set_connection', 'utf8'
      'character_set_database', 'latin1'
      'character_set_filesystem', 'binary'
      'character_set_results', 'utf8'
      'character_set_server', 'latin1'
      'character_set_system', 'utf8'
      

        Attachments

          Activity

            People

            • Assignee:
              bar Alexander Barkov
              Reporter:
              ralfneubauer2 Ralf Neubauer
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: