1 drop table if exists t1, t2, t3, t4, t5, t6;
2 create table t1 (id int(8), name varchar(32));
3 create table t2 (id int(8), name varchar(32)) ENGINE="MyISAM";
4 create table t3 (id int(8), name varchar(32)) ENGINE="MEMORY";
5 create table t4 (id int(8), name varchar(32)) ENGINE="HEAP";
6 create table t5 (id int(8), name varchar(32)) ENGINE="ARCHIVE";
7 create table t6 (id int(8), name varchar(32)) ENGINE="InnoDB";
8 insert into t1 values (1, 'first value');
9 insert into t1 values (2, 'first value');
10 insert into t1 values (3, 'first value');
11 insert into t1 values (4, 'first value');
12 insert into t1 values (5, 'first value');
13 insert into t2 values (1, 'first value');
14 insert into t2 values (2, 'first value');
15 insert into t2 values (3, 'first value');
16 insert into t2 values (4, 'first value');
17 insert into t2 values (5, 'first value');
18 insert into t3 values (1, 'first value');
19 insert into t3 values (2, 'first value');
20 insert into t3 values (3, 'first value');
21 insert into t3 values (4, 'first value');
22 insert into t3 values (5, 'first value');
23 insert into t4 values (1, 'first value');
24 insert into t4 values (2, 'first value');
25 insert into t4 values (3, 'first value');
26 insert into t4 values (4, 'first value');
27 insert into t4 values (5, 'first value');
28 insert into t5 values (1, 'first value');
29 insert into t5 values (2, 'first value');
30 insert into t5 values (3, 'first value');
31 insert into t5 values (4, 'first value');
32 insert into t5 values (5, 'first value');
33 insert into t6 values (1, 'first value');
34 insert into t6 values (2, 'first value');
35 insert into t6 values (3, 'first value');
36 insert into t6 values (4, 'first value');
37 insert into t6 values (5, 'first value');
81 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
82 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
83 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
84 /*!40101 SET NAMES utf8 */;
85 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
86 /*!40103 SET TIME_ZONE='+00:00' */;
87 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
88 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
89 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
90 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
92 CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
95 DROP TABLE IF EXISTS `t1`;
96 /*!40101 SET @saved_cs_client = @@character_set_client */;
97 /*!40101 SET character_set_client = utf8 */;
99 `id` int(8) DEFAULT NULL,
100 `name` varchar(32) DEFAULT NULL
101 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
102 /*!40101 SET character_set_client = @saved_cs_client */;
104 /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
105 INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
106 /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
107 DROP TABLE IF EXISTS `t2`;
108 /*!40101 SET @saved_cs_client = @@character_set_client */;
109 /*!40101 SET character_set_client = utf8 */;
111 `id` int(8) DEFAULT NULL,
112 `name` varchar(32) DEFAULT NULL
113 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
114 /*!40101 SET character_set_client = @saved_cs_client */;
116 /*!40000 ALTER TABLE `t2` DISABLE KEYS */;
117 INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
118 /*!40000 ALTER TABLE `t2` ENABLE KEYS */;
119 DROP TABLE IF EXISTS `t3`;
120 /*!40101 SET @saved_cs_client = @@character_set_client */;
121 /*!40101 SET character_set_client = utf8 */;
123 `id` int(8) DEFAULT NULL,
124 `name` varchar(32) DEFAULT NULL
125 ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
126 /*!40101 SET character_set_client = @saved_cs_client */;
128 /*!40000 ALTER TABLE `t3` DISABLE KEYS */;
129 INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
130 /*!40000 ALTER TABLE `t3` ENABLE KEYS */;
131 DROP TABLE IF EXISTS `t4`;
132 /*!40101 SET @saved_cs_client = @@character_set_client */;
133 /*!40101 SET character_set_client = utf8 */;
135 `id` int(8) DEFAULT NULL,
136 `name` varchar(32) DEFAULT NULL
137 ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
138 /*!40101 SET character_set_client = @saved_cs_client */;
140 /*!40000 ALTER TABLE `t4` DISABLE KEYS */;
141 INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
142 /*!40000 ALTER TABLE `t4` ENABLE KEYS */;
143 DROP TABLE IF EXISTS `t5`;
144 /*!40101 SET @saved_cs_client = @@character_set_client */;
145 /*!40101 SET character_set_client = utf8 */;
147 `id` int(8) DEFAULT NULL,
148 `name` varchar(32) DEFAULT NULL
149 ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
150 /*!40101 SET character_set_client = @saved_cs_client */;
152 /*!40000 ALTER TABLE `t5` DISABLE KEYS */;
153 INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
154 /*!40000 ALTER TABLE `t5` ENABLE KEYS */;
155 DROP TABLE IF EXISTS `t6`;
156 /*!40101 SET @saved_cs_client = @@character_set_client */;
157 /*!40101 SET character_set_client = utf8 */;
159 `id` int(8) DEFAULT NULL,
160 `name` varchar(32) DEFAULT NULL
161 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
162 /*!40101 SET character_set_client = @saved_cs_client */;
164 /*!40000 ALTER TABLE `t6` DISABLE KEYS */;
165 INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
166 /*!40000 ALTER TABLE `t6` ENABLE KEYS */;
167 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
169 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
170 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
171 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
172 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
173 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
174 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
175 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
178 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
179 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
180 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
181 /*!40101 SET NAMES utf8 */;
182 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
183 /*!40103 SET TIME_ZONE='+00:00' */;
184 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
185 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
186 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
187 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
189 CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
192 DROP TABLE IF EXISTS `t1`;
193 /*!40101 SET @saved_cs_client = @@character_set_client */;
194 /*!40101 SET character_set_client = utf8 */;
196 `id` int(8) DEFAULT NULL,
197 `name` varchar(32) DEFAULT NULL
198 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
199 /*!40101 SET character_set_client = @saved_cs_client */;
201 /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
202 INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
203 /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
204 DROP TABLE IF EXISTS `t2`;
205 /*!40101 SET @saved_cs_client = @@character_set_client */;
206 /*!40101 SET character_set_client = utf8 */;
208 `id` int(8) DEFAULT NULL,
209 `name` varchar(32) DEFAULT NULL
210 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
211 /*!40101 SET character_set_client = @saved_cs_client */;
213 /*!40000 ALTER TABLE `t2` DISABLE KEYS */;
214 INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
215 /*!40000 ALTER TABLE `t2` ENABLE KEYS */;
216 DROP TABLE IF EXISTS `t3`;
217 /*!40101 SET @saved_cs_client = @@character_set_client */;
218 /*!40101 SET character_set_client = utf8 */;
220 `id` int(8) DEFAULT NULL,
221 `name` varchar(32) DEFAULT NULL
222 ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
223 /*!40101 SET character_set_client = @saved_cs_client */;
225 /*!40000 ALTER TABLE `t3` DISABLE KEYS */;
226 INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
227 /*!40000 ALTER TABLE `t3` ENABLE KEYS */;
228 DROP TABLE IF EXISTS `t4`;
229 /*!40101 SET @saved_cs_client = @@character_set_client */;
230 /*!40101 SET character_set_client = utf8 */;
232 `id` int(8) DEFAULT NULL,
233 `name` varchar(32) DEFAULT NULL
234 ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
235 /*!40101 SET character_set_client = @saved_cs_client */;
237 /*!40000 ALTER TABLE `t4` DISABLE KEYS */;
238 INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
239 /*!40000 ALTER TABLE `t4` ENABLE KEYS */;
240 DROP TABLE IF EXISTS `t5`;
241 /*!40101 SET @saved_cs_client = @@character_set_client */;
242 /*!40101 SET character_set_client = utf8 */;
244 `id` int(8) DEFAULT NULL,
245 `name` varchar(32) DEFAULT NULL
246 ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
247 /*!40101 SET character_set_client = @saved_cs_client */;
249 /*!40000 ALTER TABLE `t5` DISABLE KEYS */;
250 INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
251 /*!40000 ALTER TABLE `t5` ENABLE KEYS */;
252 DROP TABLE IF EXISTS `t6`;
253 /*!40101 SET @saved_cs_client = @@character_set_client */;
254 /*!40101 SET character_set_client = utf8 */;
256 `id` int(8) DEFAULT NULL,
257 `name` varchar(32) DEFAULT NULL
258 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
259 /*!40101 SET character_set_client = @saved_cs_client */;
261 /*!40000 ALTER TABLE `t6` DISABLE KEYS */;
262 INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
263 /*!40000 ALTER TABLE `t6` ENABLE KEYS */;
264 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
266 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
267 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
268 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
269 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
270 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
271 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
272 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
280 SELECT @@global.storage_engine INTO @old_engine;
281 SET GLOBAL storage_engine=InnoDB;
282 CREATE VIEW v1 AS SELECT * FROM t1;
283 INSERT INTO t1 VALUES();
284 SELECT COUNT(*) FROM v1;
287 SELECT COUNT(*) FROM v1;
292 SET GLOBAL storage_engine=@old_engine;