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

Wrong I_S.COLUMNS.CHARACTER_XXX_LENGTH value for compressed columns

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3(EOL)
    • 10.3.7
    • Data types
    • None

    Description

      This script queries I_S for a latin1 compressed varchar column:

      CREATE OR REPLACE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1 COMPRESSED);
      SELECT
        CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH
      FROM
        INFORMATION_SCHEMA.COLUMNS
      WHERE
        TABLE_SCHEMA='test' AND TABLE_NAME='t1' AND COLUMN_NAME='a';
      

      +--------------------------+------------------------+
      | CHARACTER_MAXIMUM_LENGTH | CHARACTER_OCTET_LENGTH |
      +--------------------------+------------------------+
      |                       11 |                     11 |
      +--------------------------+------------------------+
      

      11 looks wrong. The expected value would be 10 for both columns.

      Now trying an utf8 column:

      CREATE OR REPLACE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COMPRESSED);
      SELECT
        CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH
      FROM
        INFORMATION_SCHEMA.COLUMNS
      WHERE
        TABLE_SCHEMA='test' AND TABLE_NAME='t1' AND COLUMN_NAME='a';
      

      +--------------------------+------------------------+
      | CHARACTER_MAXIMUM_LENGTH | CHARACTER_OCTET_LENGTH |
      +--------------------------+------------------------+
      |                       10 |                     31 |
      +--------------------------+------------------------+
      

      The value for CHARACTER_OCTET_LENGTH is wrong. The expected result is 30.

      Attachments

        Issue Links

          Activity

            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.