Ensure that table is truly dropped when using DROP TABLE (MDEV-11412)

[MDEV-22820] Bogus "Unknown table" warnings produced upon attempt to drop parent table referenced by FK Created: 2020-06-06  Updated: 2020-06-15  Resolved: 2020-06-15

Status: Closed
Project: MariaDB Server
Component/s: Server, Storage Engine - InnoDB
Affects Version/s: N/A
Fix Version/s: N/A

Type: Technical task Priority: Major
Reporter: Elena Stepanova Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates

 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'



 Comments   
Comment by Michael Widenius [ 2020-06-09 ]

Fixed. Removed the extra prints. It will be pushed soon from bb-10.5-monty

Comment by Michael Widenius [ 2020-06-15 ]

Pushed updated tree without this problem into 10.5

Generated at Thu Feb 08 09:17:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.