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

concat cap to max_allowed_packet

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.0.10
    • None
    • None
    • None

    Description

      replace into mysql.http_contents select '/history',  (select CONCAT('{"server":"zOBFqxNABETgELkfy0nYH8G+Olk=","history":[', GROUP_CONCAT(COLUMN_JSON(status)  separator ',\n') ,'\n]}')  from mysql.http_status_history ORDER BY COLUMN_GET(status,'date' as datetime) ),  'text/plain';
       
      MariaDB [(none)]> show warnings;
      +---------+------+-----------------------------------------------------------------------------+
      | Level   | Code | Message                                                                     |
      +---------+------+-----------------------------------------------------------------------------+
      | Warning | 1301 | Result of concat() was larger than max_allowed_packet (1048576) - truncated |
      +---------+------+-----------------------------------------------------------------------------+
      1 row in set (0.00 sec)
       
       select * from mysql.http_contents where name="/history";
      +----------+---------+------------+
      | name     | content | type       |
      +----------+---------+------------+
      | /history | NULL    | text/plain |
      +----------+---------+------------+
      1 row in set (0.02 sec)

      MariaDB [(none)]> select CONCAT('{"server":"zOBFqxNABETgELkfy0nYH8G+Olk=","history":[', GROUP_CONCAT(COLUMN_JSON(status)  separator ',\n') ,'\n]}') from  from mysql.http_status_history ; 
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'from mysql.http_status_history' at line 1
      MariaDB [(none)]> select CONCAT('{"server":"zOBFqxNABETgELkfy0nYH8G+Olk=","history":[', GROUP_CONCAT(COLUMN_JSON(status)  separator ',\n') ,'\n]}') from mysql.http_status_history ; 
      +----------------------------------------------------------------------------------------------------------------------------+
      | CONCAT('{"server":"zOBFqxNABETgELkfy0nYH8G+Olk=","history":[', GROUP_CONCAT(COLUMN_JSON(status)  separator ',\n') ,'\n]}') |
      +----------------------------------------------------------------------------------------------------------------------------+
      | NULL                                                                                                                       |
      +----------------------------------------------------------------------------------------------------------------------------+
      1 row in set, 1 warning (0.02 sec)

      This code works fine when max_allowed_packed is increased

      Possible issue are :

      • max_allowed_packed is not a session variable and can't be easily changed dynamically
      • should truncate the result but not return NULL on overflow
      • max_allowed_packed is documented to be the query buffer and not the query result buffer.

      Attachments

        Activity

          People

            Unassigned Unassigned
            stephane@skysql.com VAROQUI Stephane
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.