Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-11412 Ensure that table is truly dropped when using DROP TABLE
  3. MDEV-22820

Bogus "Unknown table" warnings produced upon attempt to drop parent table referenced by FK

    XMLWordPrintable

    Details

      Description

      --source include/have_innodb.inc
       
      create table t1 (a int, key(a)) engine=InnoDB;
      create table t2 (b int, foreign key(b) references t1(a)) engine=InnoDB;
      --error ER_ROW_IS_REFERENCED_2
      drop table if exists t1;
      show warnings;
       
      # Cleanup
      drop table t2, t1;
      

      Before the change, failed DROP TABLE only produced one relevant error:

      10.5

      drop table if exists t1;
      ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
      show warnings;
      Level	Code	Message
      Error	1451	Cannot delete or update a parent row: a foreign key constraint fails
      

      With MDEV-11412 as of bb-10.5-monty 645f37e49:

      drop table if exists t1;
      ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
      show warnings;
      Level	Code	Message
      Error	1451	Cannot delete or update a parent row: a foreign key constraint fails
      Warning	1051	Unknown table 'test.t1'
      Error	1051	Unknown table 'test.t1'
      

        Attachments

          Activity

            People

            Assignee:
            monty Michael Widenius
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration