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

MyISAM returns ERROR 1030 "Got error 0" instead of ERROR 1062 when adding a UNIQUE index with myisam_repair_threads=2

    XMLWordPrintable

Details

    • Hide
      With myisam_repair_threads set to 2, adding a UNIQUE index to a MyISAM table that contains duplicate values could fail with ERROR 1030 "Got error 0 ... from storage engine MyISAM" instead of the duplicate-key error 1062. The table was not damaged; only the error was wrong.
      Show
      With myisam_repair_threads set to 2, adding a UNIQUE index to a MyISAM table that contains duplicate values could fail with ERROR 1030 "Got error 0 ... from storage engine MyISAM" instead of the duplicate-key error 1062. The table was not damaged; only the error was wrong.

    Description

      Creating a UNIQUE index on a MyISAM table whose column holds 100 identical values fails with an internal error instead of the duplicate-key error, when myisam_repair_threads is 2.

      How to reproduce

      CREATE OR REPLACE TABLE t(c INT) ENGINE=MyISAM;
      SET SESSION myisam_repair_threads=2;
      INSERT INTO t SELECT 1 FROM seq_1_to_100;
      CREATE UNIQUE INDEX i ON t(c);
      -- expected: ERROR 1062 (23000): Duplicate entry '1' for key 'i'
      -- actual:   ERROR 1030 (HY000): Got error 0 "Internal error/check (Not system error)" from storage engine MyISAM
      

      Notes

      Controls on the same server: with myisam_repair_threads=1, or with 99 rows (seq_1_to_99), the statement fails with the expected 1062.

      After the failed statement, CHECK TABLE t reports OK and SELECT COUNT FROM t returns 100. This report is about the misleading error code, not about table corruption.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            Ann C Ann C
            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.