1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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

minor post-review fixes
* remove duplicate tests
* first file indicates table existance even with discovery
* don't duplicate trigger dropping code
This commit is contained in:
Sergei Golubchik
2020-06-15 12:13:44 +02:00
parent b014720b6c
commit 2bb5981c20
4 changed files with 13 additions and 75 deletions

View File

@ -8,7 +8,7 @@ db.opt
# Test droping table without frm without super privilege
create table t1(a int) engine=innodb;
create user test identified by '123456';
grant all privileges on test.t1 to 'test'@'%'identified by '123456' with grant option;
grant all privileges on test.t1 to 'test'@'%'identified by '123456';
connect con_test, localhost, test,'123456', ;
connection con_test;
drop table t1;
@ -18,10 +18,6 @@ connection default;
disconnect con_test;
drop user test;
db.opt
#Test4: drop table can drop consistent table as well
create table t1(a int) engine=innodb;
drop table t1;
db.opt
#Test5: drop table with triger, and with missing frm
create table t1(a int)engine=innodb;
create trigger t1_trg before insert on t1 for each row begin end;
@ -45,13 +41,6 @@ drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'
db.opt
#Test8: check compatibility with if exists
create table t1(a int)engine=innodb;
drop table t1;
db.opt
drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'
#Test9: check compatibility with restrict/cascade
CREATE TABLE parent (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE child (id INT, parent_id INT, INDEX par_ind (parent_id), FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE CASCADE) ENGINE=INNODB;