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

DROP DATABASE in InnoDB is case-insensitive

    XMLWordPrintable

Details

    Description

      Table names are supposed to be case-sensitive on a case-sensitive file system. Alas, as noted in MDEV-25748, DROP DATABASE would seem drop InnoDB tables in a case-insensitive fashion, affecting tables in databases whose name only differs in the letter case:

      diff --git a/mysql-test/suite/innodb/t/alter_foreign_crash.test b/mysql-test/suite/innodb/t/alter_foreign_crash.test
      index 1952a1b30d4..b65dfa175c2 100644
      --- a/mysql-test/suite/innodb/t/alter_foreign_crash.test
      +++ b/mysql-test/suite/innodb/t/alter_foreign_crash.test
      @@ -2,6 +2,7 @@
       --source include/have_debug_sync.inc
       # The embedded server does not support restarting.
       --source include/not_embedded.inc
      +--source include/have_case_sensitive_file_system.inc
       
       --echo #
       --echo # Bug #20476395 DICT_LOAD_FOREIGNS() FAILED IN
      @@ -10,6 +11,11 @@
       
       call mtr.add_suppression("InnoDB: Failed to load table");
       
      +CREATE DATABASE Bug;
      +CREATE TABLE Bug.parent(a SERIAL) ENGINE=INNODB;
      +CREATE TABLE Bug.child(a SERIAL, FOREIGN KEY f(a) REFERENCES Bug.parent(a))
      +ENGINE=INNODB;
      +
       create database bug;
       use bug;
       
      @@ -18,6 +24,7 @@ create table child(a serial, foreign key fk (a) references parent(a))engine=inno
       
       insert into parent values(1);
       insert into child values(1);
      +drop database Bug;
       
       connect (con1,localhost,root,,bug);
       SET DEBUG_SYNC='innodb_rename_table_ready SIGNAL s1 WAIT_FOR s2 EXECUTE 2';
      @@ -32,6 +39,9 @@ disconnect con1;
       
       show tables;
       alter table parent row_format=dynamic;
      -
      +select * from child;
      +--error ER_ROW_IS_REFERENCED_2
      +drop table parent;
      +drop table child;
       drop table parent;
       drop database bug;
      

      The changed test would fail in an unexpected way (not a mere result difference):

      10.2 629449172a5b0a6975663ca1ac420789e00b941d

      CURRENT_TEST: innodb.alter_foreign_crash
      mysqltest: At line 42: query 'select * from child' failed: 1146: Table 'bug.child' doesn't exist
      

      Possibly we could fix this by porting the fixes of MDEV-25691 and MDEV-25748 from MariaDB Server 10.6, but it might not be a good idea because the MDEV-25691 fix removes work-arounds for the lack of atomic DDL (MDEV-17567).

      Hence, even though I usually treat InnoDB corruption bugs at high priority, I am only filing this bug for documenting its existence. I do not plan to fix this, because the fix could cause more damage, and because the bug has existed for years without anyone complaining.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.