~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
drop table if exists t1, t2, t3, t4, t5, t6;
create table t1 (id int, name varchar(32));
create table t2 (id int, name varchar(32)) ENGINE="ARCHIVE";
create temporary table t3 (id int, name varchar(32)) ENGINE="MEMORY";
create temporary table t4 (id int, name varchar(32)) ENGINE="MEMORY";
create table t6 (id int, name varchar(32)) ENGINE="InnoDB";
insert into t1 values (1, 'first value');
insert into t1 values (2, 'first value');
insert into t1 values (3, 'first value');
insert into t1 values (4, 'first value');
insert into t1 values (5, 'first value');
insert into t2 values (1, 'first value');
insert into t2 values (2, 'first value');
insert into t2 values (3, 'first value');
insert into t2 values (4, 'first value');
insert into t2 values (5, 'first value');
insert into t3 values (1, 'first value');
insert into t3 values (2, 'first value');
insert into t3 values (3, 'first value');
insert into t3 values (4, 'first value');
insert into t3 values (5, 'first value');
insert into t4 values (1, 'first value');
insert into t4 values (2, 'first value');
insert into t4 values (3, 'first value');
insert into t4 values (4, 'first value');
insert into t4 values (5, 'first value');
insert into t6 values (1, 'first value');
insert into t6 values (2, 'first value');
insert into t6 values (3, 'first value');
insert into t6 values (4, 'first value');
insert into t6 values (5, 'first value');
select * from t1;
id	name
1	first value
2	first value
3	first value
4	first value
5	first value
select * from t2;
id	name
1	first value
2	first value
3	first value
4	first value
5	first value
select * from t3;
id	name
1	first value
2	first value
3	first value
4	first value
5	first value
select * from t4;
id	name
1	first value
2	first value
3	first value
4	first value
5	first value
select * from t6;
id	name
1	first value
2	first value
3	first value
4	first value
5	first value

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
CREATE DATABASE IF NOT EXISTS `test`;

USE `test`;

DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
  `id` INT DEFAULT NULL,
  `name` VARCHAR(32) COLLATE utf8_general_ci DEFAULT NULL
) ENGINE='InnoDB' COLLATE='utf8_general_ci';

ALTER TABLE `t1` DISABLE KEYS;
INSERT IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
ALTER TABLE `t1` ENABLE KEYS;

DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
  `id` INT DEFAULT NULL,
  `name` VARCHAR(32) COLLATE utf8_general_ci DEFAULT NULL
) ENGINE='ARCHIVE' COLLATE='utf8_general_ci';

ALTER TABLE `t2` DISABLE KEYS;
INSERT IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
ALTER TABLE `t2` ENABLE KEYS;

DROP TABLE IF EXISTS `t6`;
CREATE TABLE `t6` (
  `id` INT DEFAULT NULL,
  `name` VARCHAR(32) COLLATE utf8_general_ci DEFAULT NULL
) ENGINE='InnoDB' COLLATE='utf8_general_ci';

ALTER TABLE `t6` DISABLE KEYS;
INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
ALTER TABLE `t6` ENABLE KEYS;

SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
CREATE DATABASE IF NOT EXISTS `test`;

USE `test`;

DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
  `id` INT DEFAULT NULL,
  `name` VARCHAR(32) COLLATE utf8_general_ci DEFAULT NULL
) ENGINE='InnoDB' COLLATE='utf8_general_ci';

ALTER TABLE `t1` DISABLE KEYS;
INSERT INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
ALTER TABLE `t1` ENABLE KEYS;

DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
  `id` INT DEFAULT NULL,
  `name` VARCHAR(32) COLLATE utf8_general_ci DEFAULT NULL
) ENGINE='ARCHIVE' COLLATE='utf8_general_ci';

ALTER TABLE `t2` DISABLE KEYS;
INSERT INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
ALTER TABLE `t2` ENABLE KEYS;

DROP TABLE IF EXISTS `t6`;
CREATE TABLE `t6` (
  `id` INT DEFAULT NULL,
  `name` VARCHAR(32) COLLATE utf8_general_ci DEFAULT NULL
) ENGINE='InnoDB' COLLATE='utf8_general_ci';

ALTER TABLE `t6` DISABLE KEYS;
INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
ALTER TABLE `t6` ENABLE KEYS;

SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
drop table t1;
drop table t2;
drop table t3;
drop table t4;
drop table t6;