summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-06-09 02:04:28 +0300
committerMonty <monty@mariadb.org>2020-06-09 02:04:28 +0300
commit23d0265b52885e12a655c8a91dc15e9ab58bdd0d (patch)
treefd7417dcaef572af04380cf77921508d2c501c12
parent96e3dcd34cad1b8ac1cd0aa8ae27bfecc9cdabd6 (diff)
downloadmariadb-git-bb-10.5-monty2.tar.gz
fixup! 5b54db463317ed78763ef2f93d1f83f3153f5859bb-10.5-monty2
-rw-r--r--mysql-test/main/drop_table_force.result10
-rw-r--r--mysql-test/main/drop_table_force.test25
2 files changed, 23 insertions, 12 deletions
diff --git a/mysql-test/main/drop_table_force.result b/mysql-test/main/drop_table_force.result
index f00c776970b..401d684a3fc 100644
--- a/mysql-test/main/drop_table_force.result
+++ b/mysql-test/main/drop_table_force.result
@@ -1,11 +1,11 @@
CALL mtr.add_suppression("Operating system error number");
CALL mtr.add_suppression("The error means the system cannot");
CALL mtr.add_suppression("returned OS error 71");
-#Test1: table with missing .ibd can be dropped directly, no need to drop force
+#Test1: table with missing .ibd can be dropped directly
create table t1(a int)engine=innodb;
drop table t1;
db.opt
-#Test2: non super user has no privilege to drop force
+# 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;
@@ -18,7 +18,7 @@ connection default;
disconnect con_test;
drop user test;
db.opt
-#Test4: drop table force can drop consistent table as well
+#Test4: drop table can drop consistent table as well
create table t1(a int) engine=innodb;
drop table t1;
db.opt
@@ -37,7 +37,7 @@ ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fail
drop table child;
drop table parent;
db.opt
-#Test7: drop table force twice
+#Test7: drop table twice
create table t1(a int)engine=innodb;
drop table t1;
db.opt
@@ -69,7 +69,7 @@ drop table parent cascade;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
drop table child;
drop table parent;
-#Test10: force drop non-innodb engine table returns ok
+#Test10: drop non-innodb engine table returns ok
create table t1(a int) engine=myisam;
drop table t1;
create table t1(a int) engine=myisam;
diff --git a/mysql-test/main/drop_table_force.test b/mysql-test/main/drop_table_force.test
index 56e0a949b9f..8fdd79465b7 100644
--- a/mysql-test/main/drop_table_force.test
+++ b/mysql-test/main/drop_table_force.test
@@ -1,20 +1,31 @@
--source include/have_log_bin.inc
--source include/have_innodb.inc
+#
+# This test is based on the orginal test from Tencent for DROP TABLE ... FORCE
+# In MariaDB we did reuse the code but MariaDB does not require the FORCE
+# keyword to drop a table even if the .frm file or some engine files are
+# missing.
+# To make it easy to see the differences between the orginal code and
+# the new one, we have left some references to the original test case
+#
+
CALL mtr.add_suppression("Operating system error number");
CALL mtr.add_suppression("The error means the system cannot");
CALL mtr.add_suppression("returned OS error 71");
let $DATADIR= `select @@datadir`;
---echo #Test1: table with missing .ibd can be dropped directly, no need to drop force
+--echo #Test1: table with missing .ibd can be dropped directly
# drop table without ibd
create table t1(a int)engine=innodb;
--remove_file $DATADIR/test/t1.ibd
drop table t1;
--list_files $DATADIR/test/
---echo #Test2: non super user has no privilege to drop force
+# Original DROP TABLE .. FORCE required SUPER privilege. MariaDB doesn't
+--echo # Test droping table without frm without super privilege
+
# create table t1 and rm frm
create table t1(a int) engine=innodb;
--remove_file $DATADIR/test/t1.frm
@@ -41,7 +52,7 @@ drop user test;
# check files in datadir about t1
--list_files $DATADIR/test/
---echo #Test4: drop table force can drop consistent table as well
+--echo #Test4: drop table can drop consistent table as well
create table t1(a int) engine=innodb;
drop table t1;
@@ -80,11 +91,11 @@ drop table parent;
# check files in datadir about child and parent
--list_files $DATADIR/test/
---echo #Test7: drop table force twice
+--echo #Test7: drop table twice
create table t1(a int)engine=innodb;
--remove_file $DATADIR/test/t1.frm
-# firt drop froce will success
+# first drop table will success
drop table t1;
# check files in datadir about t1
@@ -100,7 +111,7 @@ drop table if exists t1;
create table t1(a int)engine=innodb;
--remove_file $DATADIR/test/t1.frm
-# first drop force will success
+# first drop will success
drop table t1;
# check files in datadir about t1
@@ -132,7 +143,7 @@ drop table parent cascade;
drop table child;
drop table parent;
---echo #Test10: force drop non-innodb engine table returns ok
+--echo #Test10: drop non-innodb engine table returns ok
# create myisam table t1 and rm .frm
create table t1(a int) engine=myisam;
--remove_file $DATADIR/test/t1.frm