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

InnoDB wrong error message

    XMLWordPrintable

Details

    Description

      This is seen as a random test failure of innodb.innodb-page_compression_tables in Buildbot when run immediately after innodb.foreign-keys:

      ./mtr --mem innodb.foreign-keys innodb.innodb-page_compression_tables --no-reorder
       
      innodb.innodb-page_compression_tables 'innodb' w28 [ fail ]
              Test ended at 2023-10-26 18:55:52
       
      CURRENT_TEST: innodb.innodb-page_compression_tables
      --- /home/buildbot/amd64-ubuntu-2204-debug-ps/build/mysql-test/suite/innodb/r/innodb-page_compression_tables.result	2023-10-26 18:43:16.000000000 +0000
      +++ /home/buildbot/amd64-ubuntu-2204-debug-ps/build/mysql-test/suite/innodb/r/innodb-page_compression_tables.reject	2023-10-26 18:55:50.424016588 +0000
      @@ -8,7 +8,7 @@
       Level	Code	Message
       Warning	140	InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=COMPRESSED
       Error	1005	Can't create table `test`.`innodb_compressed` (errno: 140 "Wrong create options")
      -Warning	1030	Got error 140 "Wrong create options" from storage engine InnoDB
      +Warning	1296	Got error 140 '`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f2`) REFERENCES `t1` (`f1`)' from InnoDB
       show create table innodb_compact;
       Table	Create Table
       innodb_compact	CREATE TABLE `innodb_compact` (
      @@ -27,7 +27,7 @@
       Level	Code	Message
       Warning	140	InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=REDUNDANT
       Error	1005	Can't create table `test`.`innodb_redundant` (errno: 140 "Wrong create options")
      -Warning	1030	Got error 140 "Wrong create options" from storage engine InnoDB
      +Warning	1296	Got error 140 '`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f2`) REFERENCES `t1` (`f1`)' from InnoDB
       create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
       show create table innodb_redundant;
       Table	Create Table
       
      mysqltest: Result length mismatch
      

      A simpler testcase shows the problem:

      --source include/have_innodb.inc
       
      CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY, f2 INT NOT NULL)ENGINE=InnoDB;
      CREATE TABLE t2(f1 VARCHAR(100), f2 INT NOT NULL, INDEX(f2))ENGINE=InnoDB;
      ALTER TABLE t2 ADD FOREIGN KEY(f2) REFERENCES t1(f1);
      --error ER_NO_REFERENCED_ROW_2
      INSERT INTO t2 VALUES('G', 3);
       
      --error 1005
      create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed page_compressed=1;
      show warnings;
       
      DROP TABLE t2, t1;
      

      The incorrect warning in the SHOW WARNINGS after the CREATE TABLE comes from trx->detailed_error. This is set by the failing INSERT, and errorneously does not get cleared before the error is thrown from CREATE TABLE. Thus, the old message is wrongly shown as part of the SHOW WARNINGS.

      I'm not sure where the best place would be to clear the trx->detailed_error, so assigning to you Marko in case you know.

      The bug probably isn't very critical from a user point of view, but it would be really good to get the random test failure fixed. So if we cannot get the underlying bug fixed quickly, I suggest to leave this bug open but fix the test case to not fail randomly (which is simple, just run a successful SELECT or something to clear the trx->detailed_error).

      Attachments

        Activity

          People

            marko Marko Mäkelä
            knielsen Kristian Nielsen
            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.