1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-25595 DROP part of failed CREATE OR REPLACE is not written into binary log

Do log_drop_table() in case of failed mysql_prepare_create_table().
This commit is contained in:
Aleksey Midenkov
2021-05-05 20:14:27 +03:00
parent 99f700a820
commit 22e4baaa5d
7 changed files with 83 additions and 0 deletions

View File

@@ -673,3 +673,27 @@ Variable_name Value
unique_checks OFF
DROP TABLE t1;
disconnect fresh;
connection default;
#
# MDEV-25595 DROP part of failed CREATE OR REPLACE is not written into binary log
#
reset master;
create table t as select 1 as b, 2 as b;
ERROR 42S21: Duplicate column name 'b'
create table t (old_table_field int);
create or replace table t as select 1 as b, 2 as b;
ERROR 42S21: Duplicate column name 'b'
create or replace temporary table t as select 1 as b, 2 as b;
ERROR 42S21: Duplicate column name 'b'
create table t (new_table_field int);
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 t (old_table_field int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create table t (new_table_field int)
drop table t;