mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Revert MDEV-25292 Atomic CREATE OR REPLACE TABLE
Specifically: Revert "MDEV-29664 Assertion `!n_mysql_tables_in_use' failed in innobase_close_connection" This reverts commitba875e9396
. Revert "MDEV-29620 Assertion `next_insert_id == 0' failed in handler::ha_external_lock" This reverts commitaa08a7442a
. Revert "MDEV-29628 Memory leak after CREATE OR REPLACE with foreign key" This reverts commitc579d66ba6
. Revert "MDEV-29609 create_not_windows test fails with different result" This reverts commitcb583b2f1b
. Revert "MDEV-29544 SIGSEGV in HA_CREATE_INFO::finalize_locked_tables" This reverts commitdcd66c3814
. Revert "MDEV-28933 CREATE OR REPLACE fails to recreate same constraint name" This reverts commitcf6c517632
. Revert "MDEV-28933 Moved RENAME_CONSTRAINT_IDS to include/sql_funcs.h" This reverts commitf1e1c1335b
. Revert "MDEV-28956 Locking is broken if CREATE OR REPLACE fails under LOCK TABLES" This reverts commita228ec80e3
. Revert "MDEV-25292 gcol.gcol_bugfixes --ps fix" This reverts commit24fff8267d
. Revert "MDEV-25292 Disable atomic replace for slave-generated or-replace" This reverts commit2af15914cb
. Revert "MDEV-25292 backup_log improved" This reverts commit34398a20b5
. Revert "MDEV-25292 Atomic CREATE OR REPLACE TABLE" This reverts commit93c8252f02
. Revert "MDEV-25292 Table_name class for (db, table_name, alias)" This reverts commitd145dda9c7
. Revert "MDEV-25292 ha_table_exists() cleanup and improvement" This reverts commit409b8a86de
. Revert "MDEV-25292 Cleanups" This reverts commit595dad83ad
. Revert "MDEV-25292 Refactoring: moved select_field_count into Alter_info." This reverts commitf02af1d229
.
This commit is contained in:
@ -4,7 +4,7 @@ connect con1,localhost,root,,;
|
||||
BACKUP STAGE START;
|
||||
connection default;
|
||||
#
|
||||
# Testing normal tables
|
||||
# Testing with normal tables
|
||||
#
|
||||
create table t1 (a int) engine=myisam ;
|
||||
insert into t1 values (1),(2);
|
||||
@ -19,16 +19,6 @@ optimize table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
drop table t1;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,MyISAM,0,test,t1,id: 1,,0,,,
|
||||
ALTER,MyISAM,0,test,t1,id: 1,MyISAM,0,test,t1,id: 2
|
||||
RENAME,MyISAM,0,test,t1,id: 2,MyISAM,0,test,t2,id: 2
|
||||
RENAME,MyISAM,0,test,t2,id: 2,MyISAM,0,test,t1,id: 2
|
||||
repair,MyISAM,0,test,t1,id: 2,,0,,,
|
||||
optimize,MyISAM,0,test,t1,id: 2,,0,,,
|
||||
DROP,MyISAM,0,test,t1,id: 2,,0,,,
|
||||
create table t1_innodb (a int) engine=innodb ;
|
||||
insert into t1_innodb values (1),(2);
|
||||
alter table t1_innodb add column b int;
|
||||
@ -44,17 +34,6 @@ test.t1_innodb optimize note Table does not support optimize, doing recreate + a
|
||||
test.t1_innodb optimize status OK
|
||||
drop table t1_innodb;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,InnoDB,0,test,t1_innodb,id: 1,,0,,,
|
||||
ALTER,InnoDB,0,test,t1_innodb,id: 1,InnoDB,0,test,t1_innodb,id: 2
|
||||
RENAME,InnoDB,0,test,t1_innodb,id: 2,InnoDB,0,test,t2_innodb,id: 2
|
||||
RENAME,InnoDB,0,test,t2_innodb,id: 2,InnoDB,0,test,t1_innodb,id: 2
|
||||
TRUNCATE,InnoDB,0,test,t1_innodb,id: 2,,0,,,
|
||||
repair,InnoDB,0,test,t1_innodb,id: 2,,0,,,
|
||||
ALTER,InnoDB,0,test,t1_innodb,id: 2,InnoDB,0,test,t1_innodb,id: 3
|
||||
DROP,InnoDB,0,test,t1_innodb,id: 3,,0,,,
|
||||
#
|
||||
# Testing with temporary tables (should not be logged)
|
||||
#
|
||||
create temporary table tmp_t10 (a int) engine=myisam;
|
||||
@ -64,9 +43,6 @@ rename table tmp_t11 to tmp_t10;
|
||||
truncate table tmp_t10;
|
||||
drop table tmp_t10;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
#
|
||||
# Testing with mix of normal and temporary tables
|
||||
#
|
||||
create temporary table tmp_t20 (a int);
|
||||
@ -81,13 +57,6 @@ drop table if exists tmp_t21,t21;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'test.tmp_t21'
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,MyISAM,0,test,t20,id: 1,,0,,,
|
||||
DROP,MyISAM,0,test,t20,id: 1,,0,,,
|
||||
CREATE,MyISAM,0,test,t21,id: 2,,0,,,
|
||||
DROP,MyISAM,0,test,t21,id: 2,,0,,,
|
||||
#
|
||||
# Testing create select
|
||||
#
|
||||
create table t30 (a int) ;
|
||||
@ -100,18 +69,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
create table t32 (a int) ;
|
||||
drop table if exists t30,t31,t32,tmp_t30;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'test.tmp_t30'
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,MyISAM,0,test,t30,id: 1,,0,,,
|
||||
CREATE,MyISAM,0,test,t31,id: 2,,0,,,
|
||||
DROP,MyISAM,0,test,t31,id: 2,,0,,,
|
||||
CREATE,MyISAM,0,test,t31,id: 3,,0,,,
|
||||
CREATE,MyISAM,0,test,t32,id: 4,,0,,,
|
||||
DROP,MyISAM,0,test,t30,id: 1,,0,,,
|
||||
DROP,MyISAM,0,test,t31,id: 3,,0,,,
|
||||
DROP,MyISAM,0,test,t32,id: 4,,0,,,
|
||||
Note 1051 Unknown table 'test.t31,test.tmp_t30'
|
||||
#
|
||||
# Testing create LIKE
|
||||
#
|
||||
@ -128,17 +86,6 @@ t42 CREATE TABLE `t42` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t40, t41, t42;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,MyISAM,0,test,t40,id: 1,,0,,,
|
||||
CREATE,InnoDB,0,test,t41,id: 2,,0,,,
|
||||
CREATE,MyISAM,0,test,t42,id: 3,,0,,,
|
||||
DROP,MyISAM,0,test,t42,id: 3,,0,,,
|
||||
CREATE,InnoDB,0,test,t42,id: 4,,0,,,
|
||||
DROP,MyISAM,0,test,t40,id: 1,,0,,,
|
||||
DROP,InnoDB,0,test,t41,id: 2,,0,,,
|
||||
DROP,InnoDB,0,test,t42,id: 4,,0,,,
|
||||
#
|
||||
# Testing rename
|
||||
#
|
||||
create table t50 (a int) ;
|
||||
@ -147,18 +94,6 @@ rename table t50 to t52, t51 to t53;
|
||||
rename table t52 to tmp, t53 to t52, tmp to t53;
|
||||
drop table t52,t53;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,MyISAM,0,test,t50,id: 1,,0,,,
|
||||
CREATE,MyISAM,0,test,t51,id: 2,,0,,,
|
||||
RENAME,MyISAM,0,test,t50,id: 1,MyISAM,0,test,t52,id: 1
|
||||
RENAME,MyISAM,0,test,t51,id: 2,MyISAM,0,test,t53,id: 2
|
||||
RENAME,MyISAM,0,test,t52,id: 1,MyISAM,0,test,tmp,id: 1
|
||||
RENAME,MyISAM,0,test,t53,id: 2,MyISAM,0,test,t52,id: 2
|
||||
RENAME,MyISAM,0,test,tmp,id: 1,MyISAM,0,test,t53,id: 1
|
||||
DROP,MyISAM,0,test,t52,id: 2,,0,,,
|
||||
DROP,MyISAM,0,test,t53,id: 1,,0,,,
|
||||
#
|
||||
# Testing enable/disable keys
|
||||
#
|
||||
CREATE TABLE t60 (a int(10), index(a) ) ENGINE=Aria ;
|
||||
@ -172,13 +107,6 @@ INSERT INTO t61 VALUES(1),(2),(3);
|
||||
ALTER TABLE t61 DISABLE KEYS;
|
||||
DROP TABLE t61;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,Aria,0,test,t60,id: 1,,0,,,
|
||||
CHANGE_INDEX,Aria,0,test,t60,id: 1,,0,,,
|
||||
CHANGE_INDEX,Aria,0,test,t60,id: 1,,0,,,
|
||||
DROP,Aria,0,test,t60,id: 1,,0,,,
|
||||
#
|
||||
# Testing load data
|
||||
#
|
||||
create table t70 (a date, b date, c date not null, d date) engine=aria ;
|
||||
@ -195,26 +123,11 @@ insert into t71 select * from t70;
|
||||
unlock tables;
|
||||
drop table t70,t71;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,Aria,0,test,t70,id: 1,,0,,,
|
||||
BULK_INSERT,Aria,0,test,t70,id: 1,,0,,,
|
||||
BULK_INSERT,Aria,0,test,t70,id: 1,,0,,,
|
||||
CREATE,Aria,0,test,t71,id: 2,,0,,,
|
||||
BULK_INSERT,Aria,0,test,t71,id: 2,,0,,,
|
||||
DROP,Aria,0,test,t70,id: 1,,0,,,
|
||||
DROP,Aria,0,test,t71,id: 2,,0,,,
|
||||
#
|
||||
# Testing strange table names
|
||||
#
|
||||
create table `t 1` (a int) ;
|
||||
drop table `t 1`;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,MyISAM,0,test,t@00201,id: 1,,0,,,
|
||||
DROP,MyISAM,0,test,t@00201,id: 1,,0,,,
|
||||
#
|
||||
# Testing views and triggers
|
||||
#
|
||||
create table t80 (a int, b int) engine=myisam ;
|
||||
@ -224,27 +137,12 @@ drop trigger trg;
|
||||
drop view v1;
|
||||
drop table t80;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,MyISAM,0,test,t80,id: 1,,0,,,
|
||||
CREATE,VIEW,0,test,v1,,,0,,,
|
||||
CREATE,TRIGGER,0,test,trg,,,0,,,
|
||||
DROP,TRIGGER,0,test,trg,,,0,,,
|
||||
DROP,VIEW,0,test,v1,,,0,,,
|
||||
DROP,MyISAM,0,test,t80,id: 1,,0,,,
|
||||
#
|
||||
# Testing alter to a new storage engine
|
||||
#
|
||||
create table t85 (a int primary key, b int) engine=myisam ;
|
||||
alter table t85 engine=innodb;
|
||||
drop table t85;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,MyISAM,0,test,t85,id: 1,,0,,,
|
||||
ALTER,MyISAM,0,test,t85,id: 1,InnoDB,0,test,t85,id: 2
|
||||
DROP,InnoDB,0,test,t85,id: 2,,0,,,
|
||||
#
|
||||
# Testing create/drop/alter database
|
||||
#
|
||||
create database mysqltest;
|
||||
@ -253,16 +151,6 @@ create table mysqltest.t91 (a int primary key, b int) engine=innodb;
|
||||
alter database mysqltest character set utf8;
|
||||
drop database mysqltest;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,DATABASE,0,mysqltest,,,,0,,,
|
||||
CREATE,MyISAM,0,mysqltest,t90,id: 1,,0,,,
|
||||
CREATE,InnoDB,0,mysqltest,t91,id: 2,,0,,,
|
||||
ALTER,DATABASE,0,mysqltest,,,,0,,,
|
||||
DROP,MyISAM,0,mysqltest,t90,id: 1,,0,,,
|
||||
DROP,InnoDB,0,mysqltest,t91,id: 2,,0,,,
|
||||
DROP,DATABASE,0,mysqltest,,,,0,,,
|
||||
#
|
||||
# MENT-222 bug testing
|
||||
#
|
||||
CREATE TABLE IF NOT EXISTS t_exists LIKE t_exists_template;
|
||||
@ -271,14 +159,83 @@ Note 1050 Table 't_exists' already exists
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
CREATE,MyISAM,0,test,t1,id: 1,,0,,,
|
||||
ALTER,MyISAM,0,test,t1,id: 1,MyISAM,0,test,t1,id: 2
|
||||
RENAME,MyISAM,0,test,t1,id: 2,MyISAM,0,test,t2,id: 2
|
||||
RENAME,MyISAM,0,test,t2,id: 2,MyISAM,0,test,t1,id: 2
|
||||
repair,MyISAM,0,test,t1,id: 2,,0,,,
|
||||
optimize,MyISAM,0,test,t1,id: 2,,0,,,
|
||||
DROP,MyISAM,0,test,t1,id: 2,,0,,,
|
||||
CREATE,InnoDB,0,test,t1_innodb,id: 3,,0,,,
|
||||
ALTER,InnoDB,0,test,t1_innodb,id: 3,InnoDB,0,test,t1_innodb,id: 4
|
||||
RENAME,InnoDB,0,test,t1_innodb,id: 4,InnoDB,0,test,t2_innodb,id: 4
|
||||
RENAME,InnoDB,0,test,t2_innodb,id: 4,InnoDB,0,test,t1_innodb,id: 4
|
||||
TRUNCATE,InnoDB,0,test,t1_innodb,id: 4,,0,,,
|
||||
repair,InnoDB,0,test,t1_innodb,id: 4,,0,,,
|
||||
ALTER,InnoDB,0,test,t1_innodb,id: 4,InnoDB,0,test,t1_innodb,id: 5
|
||||
DROP,InnoDB,0,test,t1_innodb,id: 5,,0,,,
|
||||
CREATE,MyISAM,0,test,t20,id: 6,,0,,,
|
||||
DROP,MyISAM,0,test,t20,id: 6,,0,,,
|
||||
CREATE,MyISAM,0,test,t21,id: 7,,0,,,
|
||||
DROP,MyISAM,0,test,t21,id: 7,,0,,,
|
||||
CREATE,MyISAM,0,test,t30,id: 8,,0,,,
|
||||
CREATE,MyISAM,0,test,t31,id: 9,,0,,,
|
||||
DROP,MyISAM,0,test,t31,id: 9,,0,,,
|
||||
CREATE,MyISAM,0,test,t31,id: 10,,0,,,
|
||||
DROP,MyISAM,0,test,t31,id: 10,,0,,,
|
||||
DROP_AFTER_CREATE,MyISAM,0,test,t31,id: 11,,0,,,
|
||||
CREATE,MyISAM,0,test,t32,id: 12,,0,,,
|
||||
DROP,MyISAM,0,test,t30,id: 8,,0,,,
|
||||
DROP,MyISAM,0,test,t32,id: 12,,0,,,
|
||||
CREATE,MyISAM,0,test,t40,id: 13,,0,,,
|
||||
CREATE,InnoDB,0,test,t41,id: 14,,0,,,
|
||||
CREATE,MyISAM,0,test,t42,id: 15,,0,,,
|
||||
DROP,MyISAM,0,test,t42,id: 15,,0,,,
|
||||
CREATE,InnoDB,0,test,t42,id: 16,,0,,,
|
||||
DROP,MyISAM,0,test,t40,id: 13,,0,,,
|
||||
DROP,InnoDB,0,test,t41,id: 14,,0,,,
|
||||
DROP,InnoDB,0,test,t42,id: 16,,0,,,
|
||||
CREATE,MyISAM,0,test,t50,id: 17,,0,,,
|
||||
CREATE,MyISAM,0,test,t51,id: 18,,0,,,
|
||||
RENAME,MyISAM,0,test,t50,id: 17,MyISAM,0,test,t52,id: 17
|
||||
RENAME,MyISAM,0,test,t51,id: 18,MyISAM,0,test,t53,id: 18
|
||||
RENAME,MyISAM,0,test,t52,id: 17,MyISAM,0,test,tmp,id: 17
|
||||
RENAME,MyISAM,0,test,t53,id: 18,MyISAM,0,test,t52,id: 18
|
||||
RENAME,MyISAM,0,test,tmp,id: 17,MyISAM,0,test,t53,id: 17
|
||||
DROP,MyISAM,0,test,t52,id: 18,,0,,,
|
||||
DROP,MyISAM,0,test,t53,id: 17,,0,,,
|
||||
CREATE,Aria,0,test,t60,id: 19,,0,,,
|
||||
CHANGE_INDEX,Aria,0,test,t60,id: 19,,0,,,
|
||||
CHANGE_INDEX,Aria,0,test,t60,id: 19,,0,,,
|
||||
DROP,Aria,0,test,t60,id: 19,,0,,,
|
||||
CREATE,Aria,0,test,t70,id: 20,,0,,,
|
||||
BULK_INSERT,Aria,0,test,t70,id: 20,,0,,,
|
||||
BULK_INSERT,Aria,0,test,t70,id: 20,,0,,,
|
||||
CREATE,Aria,0,test,t71,id: 21,,0,,,
|
||||
BULK_INSERT,Aria,0,test,t71,id: 21,,0,,,
|
||||
DROP,Aria,0,test,t70,id: 20,,0,,,
|
||||
DROP,Aria,0,test,t71,id: 21,,0,,,
|
||||
CREATE,MyISAM,0,test,t@00201,id: 22,,0,,,
|
||||
DROP,MyISAM,0,test,t@00201,id: 22,,0,,,
|
||||
CREATE,MyISAM,0,test,t80,id: 23,,0,,,
|
||||
CREATE,VIEW,0,test,v1,,,0,,,
|
||||
CREATE,TRIGGER,0,test,trg,,,0,,,
|
||||
DROP,TRIGGER,0,test,trg,,,0,,,
|
||||
DROP,VIEW,0,test,v1,,,0,,,
|
||||
DROP,MyISAM,0,test,t80,id: 23,,0,,,
|
||||
CREATE,MyISAM,0,test,t85,id: 24,,0,,,
|
||||
ALTER,MyISAM,0,test,t85,id: 24,InnoDB,0,test,t85,id: 25
|
||||
DROP,InnoDB,0,test,t85,id: 25,,0,,,
|
||||
CREATE,DATABASE,0,mysqltest,,,,0,,,
|
||||
CREATE,MyISAM,0,mysqltest,t90,id: 26,,0,,,
|
||||
CREATE,InnoDB,0,mysqltest,t91,id: 27,,0,,,
|
||||
ALTER,DATABASE,0,mysqltest,,,,0,,,
|
||||
DROP,MyISAM,0,mysqltest,t90,id: 26,,0,,,
|
||||
DROP,InnoDB,0,mysqltest,t91,id: 27,,0,,,
|
||||
DROP,DATABASE,0,mysqltest,,,,0,,,
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
DROP TABLE t_exists;
|
||||
DROP TABLE t_exists_template;
|
||||
#
|
||||
# Reading backup ddl log file
|
||||
#
|
||||
DROP,MyISAM,0,test,t_exists,id: 1,,0,,,
|
||||
DROP,MyISAM,0,test,t_exists_template,id: 2,,0,,,
|
||||
disconnect con1;
|
||||
|
Reference in New Issue
Block a user