~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/create.test

Merge Stewart's dead code removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
select * from t1;
20
20
drop table t1;
21
21
 
22
 
create temporary table t1 (a int not null auto_increment,primary key (a)) engine=MEMORY;
 
22
create temporary table t1 (a int not null auto_increment,primary key (a)) engine=heap;
23
23
drop table t1;
24
24
 
25
25
#
27
27
#
28
28
 
29
29
--error 1146
30
 
create temporary table t2 engine=MEMORY select * from t1;
 
30
create temporary table t2 engine=heap select * from t1;
31
31
--error 1146
32
32
create table t2 select auto+1 from t1;
33
33
drop table if exists t1,t2;
34
34
--error 1167
35
35
create table t1 (b char(0) not null, index(b));
36
36
--error 1163
37
 
create temporary table t1 (a int not null,b text) engine=MEMORY;
 
37
create temporary table t1 (a int not null,b text) engine=heap;
38
38
drop table if exists t1;
39
39
 
40
40
--error 1075
41
 
create temporary table t1 (ordid int not null auto_increment, ord  varchar(50) not null, primary key (ord,ordid)) engine=MEMORY;
 
41
create temporary table t1 (ordid int not null auto_increment, ord  varchar(50) not null, primary key (ord,ordid)) engine=heap;
42
42
 
43
43
-- error 1049
44
44
create table not_existing_database.test (a int);
180
180
#
181
181
# Test default table type
182
182
#
183
 
SET SESSION storage_engine="MEMORY";
 
183
SET SESSION storage_engine="heap";
184
184
SELECT @@storage_engine;
185
185
CREATE TEMPORARY TABLE t1 (a int not null);
186
186
show create table t1;
242
242
--error ER_DUP_ENTRY
243
243
create table if not exists t1 select 3 as 'a',3 as 'b';
244
244
show warnings;
245
 
--replace_column 3 # 4 # 5 #
246
 
select * from DATA_DICTIONARY.TABLE_DEFINITION_CACHE WHERE TABLE_COUNT > 1 ORDER BY TABLE_SCHEMA, TABLE_NAME;
 
245
show status like "Opened_tables";
247
246
select * from t1;
248
247
drop table t1;
249
248
 
316
315
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
317
316
show create table t2;
318
317
select * from t2;
319
 
--error 1050
320
318
create table t3 like t1;
321
319
--error 1050
322
320
create table t3 like mysqltest.t3;
327
325
--error 1050
328
326
create temporary table t3 like t1;
329
327
drop table t1, t2, t3;
 
328
drop table t3;
330
329
drop database mysqltest;
331
330
 
332
331
#
333
332
# Test default table type
334
333
#
335
 
SET SESSION storage_engine="MEMORY";
 
334
SET SESSION storage_engine="heap";
336
335
SELECT @@storage_engine;
337
336
CREATE TEMPORARY TABLE t1 (a int not null);
338
337
show create table t1;
1097
1096
# precedence
1098
1097
 
1099
1098
CREATE TEMPORARY TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1) USING HASH) ENGINE=MEMORY;
1100
 
#SHOW INDEX FROM t1;
 
1099
SHOW INDEX FROM t1;
1101
1100
DROP TABLE t1;
1102
1101
 
1103
1102
CREATE TEMPORARY TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
1104
 
#SHOW INDEX FROM t1;
 
1103
SHOW INDEX FROM t1;
1105
1104
DROP TABLE t1;
1106
1105
 
1107
1106
 
1167
1166
--error 1102
1168
1167
SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1169
1168
 
1170
 
##
1171
 
## Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
1172
 
##
 
1169
#
 
1170
# Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
 
1171
#
1173
1172
 
1174
1173
create database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1175
1174
use имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1176
1175
select database();
1177
1176
use test;
1178
1177
 
1179
 
select SCHEMA_NAME from data_dictionary.schemas
 
1178
select SCHEMA_NAME from information_schema.schemata
1180
1179
where schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45';
1181
1180
 
1182
1181
drop database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1190
1189
# database, table, field, key
1191
1190
select * from имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1192
1191
 
1193
 
select TABLE_NAME from data_dictionary.tables where
1194
 
table_schema='test';
1195
 
 
1196
 
select COLUMN_NAME from data_dictionary.columns where
1197
 
table_schema='test';
1198
 
 
1199
 
select INDEX_NAME from data_dictionary.indexes where
 
1192
select TABLE_NAME from information_schema.tables where
 
1193
table_schema='test';
 
1194
 
 
1195
select COLUMN_NAME from information_schema.columns where
 
1196
table_schema='test';
 
1197
 
 
1198
select INDEX_NAME from information_schema.statistics where
1200
1199
table_schema='test';
1201
1200
 
1202
1201
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
1204
1203
 
1205
1204
drop table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1206
1205
 
1207
 
#
 
1206
 
1208
1207
#
1209
1208
# Bug#25629 CREATE TABLE LIKE does not work with INFORMATION_SCHEMA
1210
1209
#
1211
 
--error 1005
1212
 
create table t1 like data_dictionary.processlist;
1213
 
create table t1 like data_dictionary.processlist engine=innodb;
 
1210
create table t1 like information_schema.processlist;
1214
1211
show create table t1;
1215
1212
drop table t1;
1216
 
--error 1005
1217
 
create temporary table t1 like data_dictionary.processlist;
1218
 
create temporary table t1 like data_dictionary.processlist engine=myisam;
 
1213
create temporary table t1 like information_schema.processlist;
1219
1214
show create table t1;
1220
1215
drop table t1;
1221
1216