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

Make error messages from DROP TABLE and DROP TABLE IF EXISTS consistent

- IF EXISTS ends with a list of all not existing object, instead of a
  separate note for every not existing object
- Produce a "Note" for all wrongly dropped objects
  (like trying to do DROP SEQUENCE for a normal table)
- Do not write existing tables that could not be dropped to binlog

Other things:
MDEV-22820 Bogus "Unknown table" warnings produced upon attempt to drop
           parent table referenced by FK
This was caused by an older version of this commit patch and later fixed
This commit is contained in:
Monty
2020-06-05 18:55:11 +03:00
parent 346d10a953
commit dfb41fddf6
25 changed files with 431 additions and 215 deletions

View File

@ -16,29 +16,37 @@ let $create_option=;
--error ER_BAD_TABLE_ERROR
drop table t1,t2,t3;
show warnings;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
drop table t1,t3,t2;
show warnings;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
drop table t1,t4,t2,t3;
show warnings;
--source drop_combinations.inc
drop table t1,s1,s2,t2;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
--error ER_IT_IS_A_VIEW
drop table t1,v1,v2,t2;
show warnings;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
--error ER_IT_IS_A_VIEW
drop table v1,s1,s2,v2,t2;
show warnings;
--source drop_combinations.inc
--remove_file $DATADIR/test/t1.MYD
--error ER_BAD_TABLE_ERROR
--error ER_IT_IS_A_VIEW
drop table t1,s1,v1,t3,t4;
--error ER_BAD_TABLE_ERROR
show warnings;
--error ER_IT_IS_A_VIEW
drop table s2,v2,t2,t1;
show warnings;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
--error ER_IT_IS_A_VIEW
drop table s1,v1,s2,v2;
show warnings;
--source drop_combinations.inc
--echo #
@ -58,6 +66,7 @@ drop table if exists t1,v1,v2,t2;
drop table if exists v1,s1,s2,v2,t2;
--source drop_combinations.inc
--remove_file $DATADIR/test/t1.MYD
--replace_result \\ /
drop table if exists t1,s1,v1,t3,t4;
drop table if exists s2,v2,t2,t1;
--source drop_combinations.inc
@ -79,29 +88,37 @@ let $create_option=temporary;
--error ER_BAD_TABLE_ERROR
drop temporary table t1,t2,t3;
show warnings;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
drop temporary table t1,t3,t2;
show warnings;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
drop temporary table t1,t4,t2,t3;
show warnings;
--source drop_combinations.inc
drop temporary table t1,s1,s2,t2;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
drop temporary table t1,v1,v2,t2;
show warnings;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
drop temporary table v1,s1,s2,v2,t2;
show warnings;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
drop temporary table t1,s1,v1,t3,t4;
show warnings;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
drop temporary table s2,v2,t2,t1;
show warnings;
--source drop_combinations.inc
--error ER_BAD_TABLE_ERROR
drop temporary table s1,v1,s2,v2;
show warnings;
--source drop_combinations.inc
--echo #
@ -137,30 +154,43 @@ drop temporary sequence s1,s2;
--error ER_UNKNOWN_SEQUENCES
drop sequence s1,s2,s3;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
drop sequence s1,s3,s2;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
drop sequence s1,s4,s2,s3;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
drop sequence s1,t1,t2,s2;
--error ER_NOT_SEQUENCE2
drop sequence s1,t1,t2,s2,s3,s4;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
--error ER_IT_IS_A_VIEW
drop sequence s1,v1,v2,s2;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
--error ER_IT_IS_A_VIEW
drop sequence v1,t1,t2,v2,s2;
show warnings;
--error ER_NOT_SEQUENCE2
drop sequence t1,v1,t2,v2,s2;
show warnings;
--source drop_combinations.inc
--remove_file $DATADIR/test/s1.MYD
--error ER_UNKNOWN_SEQUENCES
--replace_result \\ /
--error ER_NOT_SEQUENCE2
drop sequence s1,t1,v1,t3,s4;
--error ER_UNKNOWN_SEQUENCES
show warnings;
--error ER_NOT_SEQUENCE2
drop sequence t2,v2,s2,s1;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
--error ER_NOT_SEQUENCE2
drop sequence t1,v1,t2,v2;
show warnings;
--source drop_combinations.inc
--echo #
@ -180,6 +210,7 @@ drop sequence if exists s1,v1,v2,s2;
drop sequence if exists v1,t1,t2,v2,s2;
--source drop_combinations.inc
--remove_file $DATADIR/test/s1.MYD
--replace_result \\ /
drop sequence if exists s1,t1,v1,t3,s4;
drop sequence if exists t2,v2,s2,s1;
--source drop_combinations.inc
@ -202,29 +233,38 @@ let $create_option=temporary;
--error ER_UNKNOWN_SEQUENCES
drop temporary sequence s1,s2,s3;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
drop temporary sequence s1,s3,s2;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
drop temporary sequence s1,s4,s2,s3;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
drop temporary sequence s1,t1,t2,s2;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
drop temporary sequence s1,v1,v2,s2;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
drop temporary sequence v1,t1,t2,v2,s2;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
drop temporary sequence s1,t1,v1,t3,s4;
show warnings;
--error ER_UNKNOWN_SEQUENCES
drop temporary sequence t2,v2,s2,s1;
show warnings;
--source drop_combinations.inc
--error ER_UNKNOWN_SEQUENCES
drop temporary sequence t1,v1,t2,v2;
show warnings;
--source drop_combinations.inc
--echo #
@ -279,6 +319,7 @@ drop view v1,s1,s2,v2;
show warnings;
--source drop_combinations.inc
--remove_file $DATADIR/test/t1.MYD
--replace_result \\ /
--error ER_UNKNOWN_VIEW
drop view s1,t1,t2,s2,v2;
show warnings;