mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
- 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
211 lines
10 KiB
Plaintext
211 lines
10 KiB
Plaintext
RESET MASTER;
|
|
DROP PROCEDURE IF EXISTS db_bug_13684.p;
|
|
DROP FUNCTION IF EXISTS db_bug_13684.f;
|
|
DROP TRIGGER IF EXISTS db_bug_13684.tr;
|
|
DROP VIEW IF EXISTS db_bug_13684.v;
|
|
DROP EVENT IF EXISTS db_bug_13684.e;
|
|
DROP TABLE IF EXISTS db_bug_13684.t;
|
|
DROP DATABASE IF EXISTS db_bug_13684;
|
|
include/show_binlog_events.inc
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS db_bug_13684.p
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS db_bug_13684.f
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TRIGGER IF EXISTS db_bug_13684.tr
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684
|
|
CREATE DATABASE db_bug_13684;
|
|
CREATE TABLE db_bug_13684.t (a int);
|
|
CREATE EVENT db_bug_13684.e
|
|
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
|
|
DO
|
|
UPDATE db_bug_13684.t SET a = a + 1;
|
|
CREATE VIEW db_bug_13684.v
|
|
AS SELECT * FROM db_bug_13684.t;
|
|
CREATE TRIGGER db_bug_13684.tr BEFORE INSERT ON db_bug_13684.t
|
|
FOR EACH ROW BEGIN
|
|
END;
|
|
CREATE PROCEDURE db_bug_13684.p (OUT p1 INT)
|
|
BEGIN
|
|
END;
|
|
CREATE FUNCTION db_bug_13684.f (s CHAR(20))
|
|
RETURNS CHAR(50) DETERMINISTIC
|
|
RETURN s;
|
|
include/show_binlog_events.inc
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS db_bug_13684.p
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS db_bug_13684.f
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TRIGGER IF EXISTS db_bug_13684.tr
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # CREATE DATABASE db_bug_13684
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE TABLE db_bug_13684.t (a int)
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT db_bug_13684.e
|
|
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
|
|
DO
|
|
UPDATE db_bug_13684.t SET a = a + 1
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db_bug_13684`.`v` AS SELECT * FROM db_bug_13684.t
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER db_bug_13684.tr BEFORE INSERT ON db_bug_13684.t
|
|
FOR EACH ROW BEGIN
|
|
END
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `db_bug_13684`.`p`(OUT p1 INT)
|
|
BEGIN
|
|
END
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `db_bug_13684`.`f`(s CHAR(20)) RETURNS char(50) CHARSET latin1
|
|
DETERMINISTIC
|
|
RETURN s
|
|
DROP PROCEDURE IF EXISTS db_bug_13684.p;
|
|
DROP FUNCTION IF EXISTS db_bug_13684.f;
|
|
DROP TRIGGER IF EXISTS db_bug_13684.tr;
|
|
DROP VIEW IF EXISTS db_bug_13684.v;
|
|
DROP EVENT IF EXISTS db_bug_13684.e;
|
|
DROP TABLE IF EXISTS db_bug_13684.t;
|
|
DROP DATABASE IF EXISTS db_bug_13684;
|
|
include/show_binlog_events.inc
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS db_bug_13684.p
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS db_bug_13684.f
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TRIGGER IF EXISTS db_bug_13684.tr
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # CREATE DATABASE db_bug_13684
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE TABLE db_bug_13684.t (a int)
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT db_bug_13684.e
|
|
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
|
|
DO
|
|
UPDATE db_bug_13684.t SET a = a + 1
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `db_bug_13684`.`v` AS SELECT * FROM db_bug_13684.t
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER db_bug_13684.tr BEFORE INSERT ON db_bug_13684.t
|
|
FOR EACH ROW BEGIN
|
|
END
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `db_bug_13684`.`p`(OUT p1 INT)
|
|
BEGIN
|
|
END
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `db_bug_13684`.`f`(s CHAR(20)) RETURNS char(50) CHARSET latin1
|
|
DETERMINISTIC
|
|
RETURN s
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS db_bug_13684.p
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS db_bug_13684.f
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TRIGGER IF EXISTS db_bug_13684.tr
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684
|
|
CREATE TABLE t1(id int);
|
|
DROP TABLE /* comment */ t1;
|
|
CREATE TABLE t1(id int);
|
|
DROP TABLE IF EXISTS /* comment */ t1;
|
|
CREATE TABLE t1(id int);
|
|
DROP TABLE /**/ t1;
|
|
CREATE TABLE t1(id int);
|
|
DROP TABLE IF EXISTS /* */ t1;
|
|
include/show_binlog_events.inc
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int)
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE /* comment */ `t1` /* generated by server */
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int)
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS /* comment */ `t1` /* generated by server */
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int)
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE /**/ `t1` /* generated by server */
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int)
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS /* */ `t1` /* generated by server */
|
|
#
|
|
# MDEV-22820 Bogus "Unknown table" warnings produced upon attempt to
|
|
# drop parent table referenced by FK
|
|
#
|
|
create table t1 (a int, key(a)) engine=InnoDB;
|
|
create table t2 (b int, foreign key(b) references t1(a)) engine=InnoDB;
|
|
drop table if exists t1;
|
|
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
|
|
drop table if exists t1,t0;
|
|
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
|
|
Note 1051 Unknown table 'test.t0'
|
|
drop table t2,t1;
|
|
create table t3 (a int) engine=aria;
|
|
drop table t10,t20;
|
|
ERROR 42S02: Unknown table 'test.t10,test.t20'
|
|
drop table t10,t20,t3;
|
|
ERROR 42S02: Unknown table 'test.t10,test.t20'
|
|
drop table if exists t10,t20;
|
|
Warnings:
|
|
Note 1051 Unknown table 'test.t10,test.t20'
|
|
drop table if exists t10,t20,t3;
|
|
Warnings:
|
|
Note 1051 Unknown table 'test.t10,test.t20,test.t3'
|
|
include/show_binlog_events.inc
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; create table t1 (a int, key(a)) engine=InnoDB
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; create table t2 (b int, foreign key(b) references t1(a)) engine=InnoDB
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t0` /* generated by server */
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE `t2`,`t1` /* generated by server */
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; create table t3 (a int) engine=aria
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE `t10`,`t20`,`t3` /* generated by server */
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t10`,`t20` /* generated by server */
|
|
master-bin.000001 # Gtid # # GTID #-#-#
|
|
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t10`,`t20`,`t3` /* generated by server */
|