mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
36eba98817
Changing the default server character set from latin1 to utf8mb4.
242 lines
7.8 KiB
Text
242 lines
7.8 KiB
Text
CREATE TABLE t_exists (a INT);
|
|
CREATE TABLE t_exists_template (a INT);
|
|
connect con1,localhost,root,,;
|
|
BACKUP STAGE START;
|
|
connection default;
|
|
#
|
|
# Testing with normal tables
|
|
#
|
|
create table t1 (a int) engine=myisam ;
|
|
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;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 repair status OK
|
|
optimize table t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 optimize status OK
|
|
drop table t1;
|
|
create table t1_innodb (a int) engine=innodb ;
|
|
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;
|
|
Table Op Msg_type Msg_text
|
|
test.t1_innodb repair status OK
|
|
optimize table t1_innodb;
|
|
Table Op Msg_type Msg_text
|
|
test.t1_innodb optimize note Table does not support optimize, doing recreate + analyze instead
|
|
test.t1_innodb optimize status OK
|
|
drop table t1_innodb;
|
|
#
|
|
# Testing with temporary tables (should not be logged)
|
|
#
|
|
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;
|
|
#
|
|
# Testing with mix of normal and temporary tables
|
|
#
|
|
create temporary table tmp_t20 (a int);
|
|
create table t20 (a int) ;
|
|
drop table tmp_t20,t20;
|
|
create temporary table tmp_t21 (a int);
|
|
create table t21 (a int) ;
|
|
drop temporary table if exists tmp_t21,t21;
|
|
Warnings:
|
|
Note 1051 Unknown table 'test.t21'
|
|
drop table if exists tmp_t21,t21;
|
|
Warnings:
|
|
Note 1051 Unknown table 'test.tmp_t21'
|
|
#
|
|
# Testing create select
|
|
#
|
|
create table t30 (a int) ;
|
|
insert into t30 values (1),(1);
|
|
create table t31 (a int primary key) 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;
|
|
create or replace table t31 (a int primary key) select * from t30;
|
|
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.t31,test.tmp_t30'
|
|
#
|
|
# Testing create LIKE
|
|
#
|
|
create table t40 (a int) engine=myisam ;
|
|
create table t41 (a int, b int) engine=innodb ;
|
|
create table t42 like t40;
|
|
create temporary table t43_tmp like t40;
|
|
create or replace table t42 like t41;
|
|
show create table t42;
|
|
Table Create Table
|
|
t42 CREATE TABLE `t42` (
|
|
`a` int(11) DEFAULT NULL,
|
|
`b` int(11) DEFAULT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
|
|
drop table t40, t41, t42;
|
|
#
|
|
# Testing rename
|
|
#
|
|
create table t50 (a int) ;
|
|
create table t51 (a int, b int) ;
|
|
rename table t50 to t52, t51 to t53;
|
|
rename table t52 to tmp, t53 to t52, tmp to t53;
|
|
drop table t52,t53;
|
|
#
|
|
# Testing enable/disable keys
|
|
#
|
|
CREATE TABLE t60 (a int(10), index(a) ) ENGINE=Aria ;
|
|
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;
|
|
#
|
|
# Testing load data
|
|
#
|
|
create table t70 (a date, b date, c date not null, d date) engine=aria ;
|
|
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;
|
|
create table t71 (a date, b date, c date not null, d date) engine=aria ;
|
|
lock tables t71 write, t70 read;
|
|
insert into t71 select * from t70;
|
|
unlock tables;
|
|
drop table t70,t71;
|
|
#
|
|
# Testing strange table names
|
|
#
|
|
create table `t 1` (a int) ;
|
|
drop table `t 1`;
|
|
#
|
|
# Testing views and triggers
|
|
#
|
|
create table t80 (a int, b int) engine=myisam ;
|
|
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;
|
|
#
|
|
# 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;
|
|
#
|
|
# Testing create/drop/alter database
|
|
#
|
|
create database mysqltest;
|
|
create table mysqltest.t90 (a int primary key, b int) engine=myisam;
|
|
create table mysqltest.t91 (a int primary key, b int) engine=innodb;
|
|
alter database mysqltest character set utf8;
|
|
drop database mysqltest;
|
|
#
|
|
# MENT-222 bug testing
|
|
#
|
|
CREATE TABLE IF NOT EXISTS t_exists LIKE t_exists_template;
|
|
Warnings:
|
|
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,,,
|
|
ALTER,InnoDB,0,test,t1_innodb,id: 4,InnoDB,0,test,t1_innodb,id: 5
|
|
repair,InnoDB,0,test,t1_innodb,id: 4,,0,,,
|
|
ALTER,InnoDB,0,test,t1_innodb,id: 5,InnoDB,0,test,t1_innodb,id: 6
|
|
DROP,InnoDB,0,test,t1_innodb,id: 6,,0,,,
|
|
CREATE,MyISAM,0,test,t20,id: 7,,0,,,
|
|
DROP,MyISAM,0,test,t20,id: 7,,0,,,
|
|
CREATE,MyISAM,0,test,t21,id: 8,,0,,,
|
|
DROP,MyISAM,0,test,t21,id: 8,,0,,,
|
|
CREATE,MyISAM,0,test,t30,id: 9,,0,,,
|
|
CREATE,MyISAM,0,test,t31,id: 10,,0,,,
|
|
DROP,MyISAM,0,test,t31,id: 10,,0,,,
|
|
CREATE,MyISAM,0,test,t31,id: 11,,0,,,
|
|
DROP,MyISAM,0,test,t31,id: 11,,0,,,
|
|
DROP_AFTER_CREATE,MyISAM,0,test,t31,id: 12,,0,,,
|
|
CREATE,MyISAM,0,test,t32,id: 13,,0,,,
|
|
DROP,MyISAM,0,test,t30,id: 9,,0,,,
|
|
DROP,MyISAM,0,test,t32,id: 13,,0,,,
|
|
CREATE,MyISAM,0,test,t40,id: 14,,0,,,
|
|
CREATE,InnoDB,0,test,t41,id: 15,,0,,,
|
|
CREATE,MyISAM,0,test,t42,id: 16,,0,,,
|
|
DROP,MyISAM,0,test,t42,id: 16,,0,,,
|
|
CREATE,InnoDB,0,test,t42,id: 17,,0,,,
|
|
DROP,MyISAM,0,test,t40,id: 14,,0,,,
|
|
DROP,InnoDB,0,test,t41,id: 15,,0,,,
|
|
DROP,InnoDB,0,test,t42,id: 17,,0,,,
|
|
CREATE,MyISAM,0,test,t50,id: 18,,0,,,
|
|
CREATE,MyISAM,0,test,t51,id: 19,,0,,,
|
|
RENAME,MyISAM,0,test,t50,id: 18,MyISAM,0,test,t52,id: 18
|
|
RENAME,MyISAM,0,test,t51,id: 19,MyISAM,0,test,t53,id: 19
|
|
RENAME,MyISAM,0,test,t52,id: 18,MyISAM,0,test,tmp,id: 18
|
|
RENAME,MyISAM,0,test,t53,id: 19,MyISAM,0,test,t52,id: 19
|
|
RENAME,MyISAM,0,test,tmp,id: 18,MyISAM,0,test,t53,id: 18
|
|
DROP,MyISAM,0,test,t52,id: 19,,0,,,
|
|
DROP,MyISAM,0,test,t53,id: 18,,0,,,
|
|
CREATE,Aria,0,test,t60,id: 20,,0,,,
|
|
CHANGE_INDEX,Aria,0,test,t60,id: 20,,0,,,
|
|
CHANGE_INDEX,Aria,0,test,t60,id: 20,,0,,,
|
|
DROP,Aria,0,test,t60,id: 20,,0,,,
|
|
CREATE,Aria,0,test,t70,id: 21,,0,,,
|
|
BULK_INSERT,Aria,0,test,t70,id: 21,,0,,,
|
|
BULK_INSERT,Aria,0,test,t70,id: 21,,0,,,
|
|
CREATE,Aria,0,test,t71,id: 22,,0,,,
|
|
BULK_INSERT,Aria,0,test,t71,id: 22,,0,,,
|
|
DROP,Aria,0,test,t70,id: 21,,0,,,
|
|
DROP,Aria,0,test,t71,id: 22,,0,,,
|
|
CREATE,MyISAM,0,test,t@00201,id: 23,,0,,,
|
|
DROP,MyISAM,0,test,t@00201,id: 23,,0,,,
|
|
CREATE,MyISAM,0,test,t80,id: 24,,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: 24,,0,,,
|
|
CREATE,MyISAM,0,test,t85,id: 25,,0,,,
|
|
ALTER,MyISAM,0,test,t85,id: 25,InnoDB,0,test,t85,id: 26
|
|
DROP,InnoDB,0,test,t85,id: 26,,0,,,
|
|
CREATE,DATABASE,0,mysqltest,,,,0,,,
|
|
CREATE,MyISAM,0,mysqltest,t90,id: 27,,0,,,
|
|
CREATE,InnoDB,0,mysqltest,t91,id: 28,,0,,,
|
|
ALTER,DATABASE,0,mysqltest,,,,0,,,
|
|
DROP,MyISAM,0,mysqltest,t90,id: 27,,0,,,
|
|
DROP,InnoDB,0,mysqltest,t91,id: 28,,0,,,
|
|
DROP,DATABASE,0,mysqltest,,,,0,,,
|
|
#
|
|
# Cleanup
|
|
#
|
|
DROP TABLE t_exists;
|
|
DROP TABLE t_exists_template;
|
|
disconnect con1;
|