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

Bogus error message "Found wrong key definition ..; Please do "ALTER TABLE .. FORCE" to fix it!"

    XMLWordPrintable

Details

    Description

      INSTALL SONAME 'ha_archive';
       
      CREATE TABLE t (a DECIMAL(20) NOT NULL) ENGINE=Archive;
      --error ER_CANT_CREATE_TABLE
      ALTER TABLE t ADD INDEX(a);
      SHOW WARNINGS;
       
      # Cleanup
      DROP TABLE t;
      UNINSTALL SONAME 'ha_archive';
      

      10.4 64f44b22d9a3dab3d4c0b77addbcbdafde57b466

      ALTER TABLE t ADD INDEX(a);
      ERROR HY000: Can't create table `test`.`t` (errno: 140 "Wrong create options")
      SHOW WARNINGS;
      Level	Code	Message
      Note	1071	Specified key was too long; max key length is 8 bytes
      Warning	1194	Found wrong key definition in t; Please do "ALTER TABLE 't' FORCE" to fix it!
      Warning	1194	Found wrong key definition in t; Please do "ALTER TABLE 't' FORCE" to fix it!
      Error	1005	Can't create table `test`.`t` (errno: 140 "Wrong create options")
      Warning	1030	Got error 140 "Wrong create options" from storage engine ARCHIVE
      DROP TABLE t;
      UNINSTALL SONAME 'ha_archive';
      bug.x                               [ fail ]  Found warnings/errors in server log file!
              Test ended at 2023-12-04 22:06:46
      line
      2023-12-04 22:06:46 4 [ERROR] Found wrong key definition in t; Please do "ALTER TABLE 't' FORCE " to fix it!
      2023-12-04 22:06:46 4 [ERROR] Found wrong key definition in t; Please do "ALTER TABLE 't' FORCE " to fix it!
      ^ Found warnings in /mnt8t/bld/10.4-asan/mysql-test/var/log/mysqld.1.err
      

      The actual error is ER_TOO_LONG_KEY "Specified key was too long; max key length is 8 bytes", which due to the way errors are handled is downgraded to a note and hidden behind ER_CANT_CREATE_TABLE / errno: 140 "Wrong create options".
      However, 1194 Found wrong key definition in t; Please do "ALTER TABLE 't' FORCE" to fix it! which is returned as a warning to the client and written as an error in the error log is irrelevant here at all.

      Attachments

        Activity

          People

            Unassigned Unassigned
            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.