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

Table corruption with UNIQUE HASH key on a partitioned table (yet another one)

    XMLWordPrintable

Details

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t (id int, c char(120), UNIQUE KEY USING HASH (id,c))
        PARTITION BY RANGE (id) (PARTITION p1 VALUES LESS THAN (10));
       
      ALTER TABLE t ADD PARTITION (PARTITION p2 VALUES LESS THAN (100));
      ALTER TABLE t FORCE;
      ALTER TABLE t FORCE;
      

      With InnoDB it causes ER_CRASHED_ON_USAGE followed by ER_NO_SUCH_TABLE_IN_ENGINE:

      10.4 d74d9596

      Query OK, 0 rows affected (0.158 sec)
      Records: 0  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> ALTER TABLE t FORCE;
      ERROR 1194 (HY000): Table 't' is marked as crashed and should be repaired
      MariaDB [test]> ALTER TABLE t FORCE;
      ERROR 1932 (42S02): Table 'test.t' doesn't exist in engine
      

      With MyISAM it's ER_GET_ERRNO (error code 190):

      MariaDB [test]> ALTER TABLE t ADD PARTITION (PARTITION p2 VALUES LESS THAN (100));
      Query OK, 0 rows affected (0.024 sec)
      Records: 0  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> ALTER TABLE t FORCE;
      ERROR 1030 (HY000): Got error 190 "Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You have to dump an" from storage engine MyISAM
      MariaDB [test]> ALTER TABLE t FORCE;
      ERROR 1030 (HY000): Got error 190 "Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine. You have to dump an" from storage engine MyISAM
      

      Related to UNIQUE HASH KEY, hence not reproducible on 10.3.

      Attachments

        Activity

          People

            elenst Elena Stepanova
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.