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

collation_connection and db_collation are too short in mysql.proc and mysql.event

Details

    Description

      The patch for MDEV-27009 changed the maximum collation name size from 32 to 64:

      -#define MY_CS_NAME_SIZE                        32
      +#define MY_CS_CHARACTER_SET_NAME_SIZE   32
      +#define MY_CS_COLLATION_NAME_SIZE       64
      

      INFORMATION_SCHEMA tables were fixed accordinly. However, tables mysql.proc and mysql.event were forgotten:

      SELECT table_schema, table_name, column_name, column_type
      FROM information_schema.columns WHERE column_name LIKE '%colla%';
      

      +--------------------+---------------------------------------+------------------------+-------------+
      | table_schema       | table_name                            | column_name            | column_type |
      +--------------------+---------------------------------------+------------------------+-------------+
      | mysql              | proc                                  | collation_connection   | char(32)    |
      | mysql              | proc                                  | db_collation           | char(32)    |
      | mysql              | event                                 | collation_connection   | char(32)    |
      | mysql              | event                                 | db_collation           | char(32)    |
      | information_schema | CHARACTER_SETS                        | DEFAULT_COLLATE_NAME   | varchar(64) |
      | information_schema | COLLATIONS                            | COLLATION_NAME         | varchar(64) |
      | information_schema | COLLATION_CHARACTER_SET_APPLICABILITY | COLLATION_NAME         | varchar(64) |
      | information_schema | COLLATION_CHARACTER_SET_APPLICABILITY | FULL_COLLATION_NAME    | varchar(64) |
      | information_schema | COLUMNS                               | COLLATION_NAME         | varchar(64) |
      | information_schema | EVENTS                                | COLLATION_CONNECTION   | varchar(64) |
      | information_schema | EVENTS                                | DATABASE_COLLATION     | varchar(64) |
      | information_schema | PARAMETERS                            | COLLATION_NAME         | varchar(64) |
      | information_schema | ROUTINES                              | COLLATION_NAME         | varchar(64) |
      | information_schema | ROUTINES                              | COLLATION_CONNECTION   | varchar(64) |
      | information_schema | ROUTINES                              | DATABASE_COLLATION     | varchar(64) |
      | information_schema | SCHEMATA                              | DEFAULT_COLLATION_NAME | varchar(64) |
      | information_schema | STATISTICS                            | COLLATION              | varchar(1)  |
      | information_schema | TABLES                                | TABLE_COLLATION        | varchar(64) |
      | information_schema | TRIGGERS                              | COLLATION_CONNECTION   | varchar(64) |
      | information_schema | TRIGGERS                              | DATABASE_COLLATION     | varchar(64) |
      | information_schema | VIEWS                                 | COLLATION_CONNECTION   | varchar(64) |
      +--------------------+---------------------------------------+------------------------+-------------+
      

      Some new collation names do not fit into 32 characters:

      SET NAMES 'utf8mb3' COLLATE 'utf8mb3_uca1400_swedish_nopad_ai_ci';
      CREATE FUNCTION f1() RETURNS INT RETURN 1;
      

      ERROR 1607 (HY000): Cannot create stored routine `f1`. Check warnings
      

      SHOW WARNINGS;
      

      +---------+------+--------------------------------------------------------------+
      | Level   | Code | Message                                                      |
      +---------+------+--------------------------------------------------------------+
      | Warning | 1265 | Data truncated for column 'collation_connection' at row 3226 |
      | Error   | 1607 | Cannot create stored routine `f1`. Check warnings            |
      +---------+------+--------------------------------------------------------------+
      

      Definitions for mysql.proc and mysql.event should be updated to use char(64) as the data type for the mentioned columns.

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov added a comment - Hello serg , please review a patch: https://github.com/MariaDB/server/commit/1a016e9524c8efae0667bf3cbe104c7316fab023

            1a016e9524c is ok to push

            serg Sergei Golubchik added a comment - 1a016e9524c is ok to push

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.