mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
2bd41fc5bf
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
.
155 lines
4.4 KiB
PHP
155 lines
4.4 KiB
PHP
# This file is used for common DDL log test for both partiotioned
|
|
# and non-partitioned tables.
|
|
# Parameters:
|
|
# $part_int - partition definition for int field, must be empty for
|
|
# non-partitioned testing
|
|
# $part_date - partition definition for date field, must be empty for
|
|
# non-partitioned testing
|
|
|
|
--echo #
|
|
--echo # Testing with normal tables
|
|
--echo #
|
|
|
|
eval create table t1 (a int) engine=myisam $part_int;
|
|
insert into t1 values (1),(2);
|
|
alter table t1 add column b int;
|
|
alter table t1 rename as t2;
|
|
rename table t2 to t1;
|
|
truncate table t1;
|
|
repair table t1;
|
|
optimize table t1;
|
|
drop table t1;
|
|
|
|
eval create table t1_innodb (a int) engine=innodb $part_int;
|
|
insert into t1_innodb values (1),(2);
|
|
alter table t1_innodb add column b int;
|
|
alter table t1_innodb rename as t2_innodb;
|
|
rename table t2_innodb to t1_innodb;
|
|
truncate table t1_innodb;
|
|
repair table t1_innodb;
|
|
optimize table t1_innodb;
|
|
drop table t1_innodb;
|
|
|
|
--echo #
|
|
--echo # Testing with temporary tables (should not be logged)
|
|
--echo #
|
|
|
|
create temporary table tmp_t10 (a int) engine=myisam;
|
|
alter table tmp_t10 add column b int;
|
|
alter table tmp_t10 rename as tmp_t11;
|
|
rename table tmp_t11 to tmp_t10;
|
|
truncate table tmp_t10;
|
|
drop table tmp_t10;
|
|
|
|
--echo #
|
|
--echo # Testing with mix of normal and temporary tables
|
|
--echo #
|
|
|
|
create temporary table tmp_t20 (a int);
|
|
eval create table t20 (a int) $part_int;
|
|
drop table tmp_t20,t20;
|
|
|
|
create temporary table tmp_t21 (a int);
|
|
eval create table t21 (a int) $part_int;
|
|
drop temporary table if exists tmp_t21,t21;
|
|
drop table if exists tmp_t21,t21;
|
|
|
|
--echo #
|
|
--echo # Testing create select
|
|
--echo #
|
|
|
|
eval create table t30 (a int) $part_int;
|
|
insert into t30 values (1),(1);
|
|
eval create table t31 (a int primary key) $part_int select * from t30 limit 1;
|
|
create or replace table t31 select * from t30 limit 1;
|
|
create or replace temporary table t30_dup select * from t30 limit 1;
|
|
--error ER_DUP_ENTRY
|
|
eval create or replace table t31 (a int primary key) $part_int select * from t30;
|
|
eval create table t32 (a int) $part_int;
|
|
drop table if exists t30,t31,t32,tmp_t30;
|
|
|
|
--echo #
|
|
--echo # Testing create LIKE
|
|
--echo #
|
|
eval create table t40 (a int) engine=myisam $part_int;
|
|
eval create table t41 (a int, b int) engine=innodb $part_int;
|
|
create table t42 like t40;
|
|
if (!$part_int) {
|
|
create temporary table t43_tmp like t40;
|
|
}
|
|
create or replace table t42 like t41;
|
|
show create table t42;
|
|
drop table t40, t41, t42;
|
|
|
|
--echo #
|
|
--echo # Testing rename
|
|
--echo #
|
|
|
|
eval create table t50 (a int) $part_int;
|
|
eval create table t51 (a int, b int) $part_int;
|
|
rename table t50 to t52, t51 to t53;
|
|
rename table t52 to tmp, t53 to t52, tmp to t53;
|
|
drop table t52,t53;
|
|
|
|
--echo #
|
|
--echo # Testing enable/disable keys
|
|
--echo #
|
|
|
|
eval CREATE TABLE t60 (a int(10), index(a) ) ENGINE=Aria $part_int;
|
|
INSERT INTO t60 VALUES(1),(2),(3);
|
|
ALTER TABLE t60 DISABLE KEYS;
|
|
INSERT INTO t60 VALUES(4),(5),(6);
|
|
ALTER TABLE t60 ENABLE KEYS;
|
|
DROP TABLE t60;
|
|
|
|
CREATE TEMPORARY TABLE t61 (i int(10), index(i) ) ENGINE=Aria;
|
|
INSERT INTO t61 VALUES(1),(2),(3);
|
|
ALTER TABLE t61 DISABLE KEYS;
|
|
DROP TABLE t61;
|
|
|
|
--echo #
|
|
--echo # Testing load data
|
|
--echo #
|
|
|
|
eval create table t70 (a date, b date, c date not null, d date) engine=aria $part_date;
|
|
--disable_warnings
|
|
load data infile '../../std_data/loaddata1.dat' ignore into table t70 fields terminated by ',';
|
|
load data infile '../../std_data/loaddata1.dat' ignore into table t70 fields terminated by ',';
|
|
truncate table t70;
|
|
lock table t70 write;
|
|
load data infile '../../std_data/loaddata1.dat' ignore into table t70 fields terminated by ',';
|
|
load data infile '../../std_data/loaddata1.dat' ignore into table t70 fields terminated by ',';
|
|
unlock tables;
|
|
--enable_warnings
|
|
|
|
eval create table t71 (a date, b date, c date not null, d date) engine=aria $part_date;
|
|
lock tables t71 write, t70 read;
|
|
insert into t71 select * from t70;
|
|
unlock tables;
|
|
drop table t70,t71;
|
|
|
|
--echo #
|
|
--echo # Testing strange table names
|
|
--echo #
|
|
|
|
eval create table `t 1` (a int) $part_int;
|
|
drop table `t 1`;
|
|
|
|
--echo #
|
|
--echo # Testing views and triggers
|
|
--echo #
|
|
|
|
eval create table t80 (a int, b int) engine=myisam $part_int;
|
|
create view v1 as select * from t80;
|
|
create trigger trg before insert on t80 for each row set @b:=1;
|
|
drop trigger trg;
|
|
drop view v1;
|
|
drop table t80;
|
|
|
|
--echo #
|
|
--echo # Testing alter to a new storage engine
|
|
--echo #
|
|
|
|
eval create table t85 (a int primary key, b int) engine=myisam $part_int;
|
|
alter table t85 engine=innodb;
|
|
drop table t85;
|