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

Table rebuild fails or corrupts contents of compressed column with some character sets

    XMLWordPrintable

Details

    Description

      CREATE OR REPLACE TABLE t (c VARCHAR(16) COMPRESSED) ENGINE=MyISAM CHARACTER SET utf32;
      INSERT INTO t VALUES ('n');
      ALTER TABLE t FORCE;
      SELECT c, HEX(c) FROM t;
      ALTER IGNORE TABLE t FORCE;
      SELECT c, HEX(c) FROM t;
      

      ALTER fails with

      10.3 333d6c30

      MariaDB [test]> ALTER TABLE t FORCE;
      ERROR 1265 (01000): Data truncated for column 'c' at row 1
      

      for no good reason, as far as I can tell.

      ALTER IGNORE does what the error/warning threatens to and truncates the data:

      MariaDB [test]> SELECT c, HEX(c) FROM t;
      +------+----------+
      | c    | HEX(c)   |
      +------+----------+
      | n    | 0000006E |
      +------+----------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> ALTER IGNORE TABLE t FORCE;
      Query OK, 1 row affected, 1 warning (0.006 sec)    
      Records: 1  Duplicates: 0  Warnings: 1
       
      MariaDB [test]> SELECT c, HEX(c) FROM t;
      +------+--------+
      | c    | HEX(c) |
      +------+--------+
      | ??   | 000000 |
      +------+--------+
      1 row in set (0.001 sec)
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.