1
drop table if exists t1, t2, t3, t4, t5, t6;
2
create table t1 (id int, name varchar(32));
3
create table t2 (id int, name varchar(32)) ENGINE="ARCHIVE";
4
create temporary table t3 (id int, name varchar(32)) ENGINE="MEMORY";
5
create temporary table t4 (id int, name varchar(32)) ENGINE="HEAP";
6
create table t6 (id int, name varchar(32)) ENGINE="InnoDB";
7
insert into t1 values (1, 'first value');
8
insert into t1 values (2, 'first value');
9
insert into t1 values (3, 'first value');
10
insert into t1 values (4, 'first value');
11
insert into t1 values (5, 'first value');
12
insert into t2 values (1, 'first value');
13
insert into t2 values (2, 'first value');
14
insert into t2 values (3, 'first value');
15
insert into t2 values (4, 'first value');
16
insert into t2 values (5, 'first value');
17
insert into t3 values (1, 'first value');
18
insert into t3 values (2, 'first value');
19
insert into t3 values (3, 'first value');
20
insert into t3 values (4, 'first value');
21
insert into t3 values (5, 'first value');
22
insert into t4 values (1, 'first value');
23
insert into t4 values (2, 'first value');
24
insert into t4 values (3, 'first value');
25
insert into t4 values (4, 'first value');
26
insert into t4 values (5, 'first value');
27
insert into t6 values (1, 'first value');
28
insert into t6 values (2, 'first value');
29
insert into t6 values (3, 'first value');
30
insert into t6 values (4, 'first value');
31
insert into t6 values (5, 'first value');
67
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
68
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
70
CREATE DATABASE IF NOT EXISTS `test`;
73
DROP TABLE IF EXISTS `t2`;
75
`id` int DEFAULT NULL,
76
`name` varchar(32) DEFAULT NULL
79
ALTER TABLE `t2` DISABLE KEYS;
80
INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
81
ALTER TABLE `t2` ENABLE KEYS;
82
DROP TABLE IF EXISTS `t1`;
84
`id` int DEFAULT NULL,
85
`name` varchar(32) DEFAULT NULL
88
ALTER TABLE `t1` DISABLE KEYS;
89
INSERT IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
90
ALTER TABLE `t1` ENABLE KEYS;
91
DROP TABLE IF EXISTS `t6`;
93
`id` int DEFAULT NULL,
94
`name` varchar(32) DEFAULT NULL
97
ALTER TABLE `t6` DISABLE KEYS;
98
INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
99
ALTER TABLE `t6` ENABLE KEYS;
100
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
101
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
102
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
103
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
105
CREATE DATABASE IF NOT EXISTS `test`;
108
DROP TABLE IF EXISTS `t2`;
110
`id` int DEFAULT NULL,
111
`name` varchar(32) DEFAULT NULL
114
ALTER TABLE `t2` DISABLE KEYS;
115
INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
116
ALTER TABLE `t2` ENABLE KEYS;
117
DROP TABLE IF EXISTS `t1`;
119
`id` int DEFAULT NULL,
120
`name` varchar(32) DEFAULT NULL
123
ALTER TABLE `t1` DISABLE KEYS;
124
INSERT INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
125
ALTER TABLE `t1` ENABLE KEYS;
126
DROP TABLE IF EXISTS `t6`;
128
`id` int DEFAULT NULL,
129
`name` varchar(32) DEFAULT NULL
132
ALTER TABLE `t6` DISABLE KEYS;
133
INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
134
ALTER TABLE `t6` ENABLE KEYS;
135
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
136
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;