15
15
create table t1 (b char(0) not null);
16
16
create table if not exists t1 (b char(0) not null);
17
--error ER_BAD_NULL_ERROR
18
17
insert into t1 values (""),(null);
22
create temporary table t1 (a int not null auto_increment,primary key (a)) engine=MEMORY;
21
create table t1 (a int not null auto_increment,primary key (a)) engine=heap;
26
25
# Test of some CREATE TABLE'S that should fail
29
--error ER_NO_SUCH_TABLE
30
create temporary table t2 engine=MEMORY select * from t1;
31
--error ER_NO_SUCH_TABLE
29
create table t2 engine=heap select * from t1;
32
31
create table t2 select auto+1 from t1;
33
32
drop table if exists t1,t2;
34
--error ER_WRONG_KEY_COLUMN
35
34
create table t1 (b char(0) not null, index(b));
36
--error ER_TABLE_CANT_HANDLE_BLOB
37
create temporary table t1 (a int not null,b text) engine=MEMORY;
36
create table t1 (a int not null,b text) engine=heap;
38
37
drop table if exists t1;
40
--error ER_WRONG_AUTO_KEY
41
create temporary table t1 (ordid int not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=MEMORY;
40
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;
44
43
create table not_existing_database.test (a int);
45
44
create table `a/a` (a int);
46
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
47
45
show create table `a/a`;
48
46
create table t1 like `a/a`;
49
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
51
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
52
show create table `t1`;
55
--error ER_WRONG_TABLE_NAME
56
50
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);
57
--error ER_TOO_LONG_IDENT
58
52
create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int);
61
55
# Some wrong defaults, so these creates should fail too (Bug #5902)
63
--error ER_INVALID_DEFAULT
64
58
create table t1 (a datetime default now());
65
--error ER_INVALID_ON_UPDATE
66
60
create table t1 (a datetime on update now());
67
--error ER_INVALID_DEFAULT
68
62
create table t1 (a int default 100 auto_increment);
69
# TODO: Should this really fail? What's wrong with default 1000 ???
70
#--error ER_INVALID_DEFAULT
71
#create table t1 (a int default 1000);
72
--error ER_INVALID_DEFAULT
64
create table t1 (a int default 1000);
73
66
create table t1 (a varchar(5) default 'abcdef');
75
68
create table t1 (a varchar(5) default 'abcde');
76
69
insert into t1 values();
78
--error ER_INVALID_DEFAULT
79
72
alter table t1 alter column a set default 'abcdef';
174
167
create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));
175
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
176
168
show create table t1;
178
170
create table t1 select if(1,'1','0'), month("2002-08-02");
303
288
select @@warning_count;
304
289
--enable_ps_protocol
305
290
create temporary table t3 like t2;
306
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
307
291
show create table t3;
308
292
select * from t3;
310
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
311
294
show create table t3;
312
295
select * from t3;
313
296
drop table t2, t3;
314
297
create database mysqltest;
315
298
create table mysqltest.t3 like t1;
316
299
create temporary table t3 like mysqltest.t3;
317
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
318
300
show create table t3;
319
301
create table t2 like t3;
320
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
321
302
show create table t2;
322
303
select * from t2;
323
--error ER_TABLE_EXISTS_ERROR
324
304
create table t3 like t1;
325
--error ER_TABLE_EXISTS_ERROR
326
306
create table t3 like mysqltest.t3;
327
--error ER_BAD_DB_ERROR
328
308
create table non_existing_database.t1 like t1;
329
309
--error ER_NO_SUCH_TABLE
330
310
create table t3 like non_existing_table;
331
--error ER_TABLE_EXISTS_ERROR
332
312
create temporary table t3 like t1;
333
313
drop table t1, t2, t3;
334
315
drop database mysqltest;
337
318
# Test default table type
339
SET SESSION storage_engine="MEMORY";
320
SET SESSION storage_engine="heap";
340
321
SELECT @@storage_engine;
341
CREATE TEMPORARY TABLE t1 (a int not null);
322
CREATE TABLE t1 (a int not null);
342
323
show create table t1;
344
--error ER_UNKNOWN_STORAGE_ENGINE
345
326
SET SESSION storage_engine="gemini";
346
327
SELECT @@storage_engine;
347
CREATE TEMPORARY TABLE t1 (a int not null);
328
CREATE TABLE t1 (a int not null);
348
329
show create table t1;
349
330
SET SESSION storage_engine=default;
353
334
# Test types of data for create select with functions
356
create table t1(a int,b int,c int,d date,e char,f datetime,h blob);
337
create table t1(a int,b int,c int,d date,e char,f datetime,g time,h blob);
357
338
insert into t1(a)values(1);
358
insert into t1(a,b,c,d,e,f,h)
359
values(2,-2,2,'1825-12-14','a','2003-01-01 03:02:01','binary data');
339
insert into t1(a,b,c,d,e,f,g,h)
340
values(2,-2,2,'1825-12-14','a','2003-1-1 3:2:1','4:3:2','binary data');
360
341
select * from t1;
343
ifnull(b,cast(-7 as signed)) as b,
344
ifnull(c,cast(7 as)) as c,
364
345
ifnull(d,cast('2000-01-01' as date)) as d,
365
346
ifnull(e,cast('b' as char)) as e,
366
347
ifnull(f,cast('2000-01-01' as datetime)) as f,
367
ifnull(h,cast('yet another binary data' as binary)) as h
348
ifnull(g,cast('5:4:3' as time)) as g,
349
ifnull(h,cast('yet another binary data' as binary)) as h,
350
addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd
356
ifnull(b,cast(-7 as signed)) as b,
357
ifnull(c,cast(7 as)) as c,
375
358
ifnull(d,cast('2000-01-01' as date)) as d,
376
359
ifnull(e,cast('b' as char)) as e,
377
360
ifnull(f,cast('2000-01-01' as datetime)) as f,
378
ifnull(h,cast('yet another binary data' as binary)) as h
361
ifnull(g,cast('5:4:3' as time)) as g,
362
ifnull(h,cast('yet another binary data' as binary)) as h,
363
addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd
381
366
select * from t2;
382
367
drop table t1, t2;
384
create table t1 (a int, b int, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), j date, k timestamp, l datetime, m enum('a','b'), o char(10));
385
SHOW CREATE TABLE t1;
386
create table t2 select ifnull(a,a), ifnull(b,b), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(o,o) from t1;
387
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
369
create table t1 (a int, b int, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
370
create table t2 select ifnull(a,a), ifnull(b,b), ifnull(c,c), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(i,i), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(n,n), ifnull(o,o) from t1;
388
371
show create table t2;
389
372
drop table t1,t2;
412
395
# test for bug #1427 "enum allows duplicate values in the list"
415
create table t1(cenum enum('a'));
416
--error ER_DUPLICATED_VALUE_IN_TYPE
417
create table t2(cenum enum('a','a'));
418
--error ER_DUPLICATED_VALUE_IN_TYPE
419
create table t3(cenum enum('a','A','a','c','c'));
398
create table t1(cenum enum('a'), cset set('b'));
399
create table t2(cenum enum('a','a'), cset set('b','b'));
400
create table t3(cenum enum('a','A','a','c','c'), cset set('b','B','b','d','d'));
401
drop table t1, t2, t3;
428
409
select database();
429
410
drop database mysqltest;
430
411
select database();
413
# Connect without a database as user mysqltest_1
414
create user mysqltest_1;
415
connect (user1,localhost,mysqltest_1,,*NO-ONE*);
417
select database(), user();
420
drop user mysqltest_1;
434
424
# Test for Bug 856 'Naming a key "Primary" causes trouble'
437
## TODO: Is this really a bug? It works in Drizzle. Should it?
438
#--error ER_WRONG_NAME_FOR_INDEX
439
#create table t1 (a int, index `primary` (a));
440
#--error ER_WRONG_NAME_FOR_INDEX
441
#create table t1 (a int, index `PRIMARY` (a));
443
#create table t1 (`primary` int, index(`primary`));
444
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
445
#show create table t1;
446
#create table t2 (`PRIMARY` int, index(`PRIMARY`));
447
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
448
#show create table t2;
450
#create table t3 (a int);
451
#--error ER_WRONG_NAME_FOR_INDEX
452
#alter table t3 add index `primary` (a);
453
#--error ER_WRONG_NAME_FOR_INDEX
454
#alter table t3 add index `PRIMARY` (a);
456
#create table t4 (`primary` int);
457
#alter table t4 add index(`primary`);
458
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
459
#show create table t4;
460
#create table t5 (`PRIMARY` int);
461
#alter table t5 add index(`PRIMARY`);
462
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
463
#show create table t5;
465
#drop table t1, t2, t3, t4, t5;
428
create table t1 (a int, index `primary` (a));
430
create table t1 (a int, index `PRIMARY` (a));
432
create table t1 (`primary` int, index(`primary`));
433
show create table t1;
434
create table t2 (`PRIMARY` int, index(`PRIMARY`));
435
show create table t2;
437
create table t3 (a int);
439
alter table t3 add index `primary` (a);
441
alter table t3 add index `PRIMARY` (a);
443
create table t4 (`primary` int);
444
alter table t4 add index(`primary`);
445
show create table t4;
446
create table t5 (`PRIMARY` int);
447
alter table t5 add index(`PRIMARY`);
448
show create table t5;
450
drop table t1, t2, t3, t4, t5;
468
453
# bug #3266 TEXT in CREATE TABLE SELECT
561
565
# calculation of number of NULLs.
563
567
CREATE TABLE t2 (
568
a int(11) default NULL
566
570
insert into t2 values(111);
569
573
create table t1 (
570
a varchar(12) collate utf8_bin not null,
574
a varchar(12) charset utf8 collate utf8_bin not null,
571
575
b int not null, primary key (a)
572
576
) select a, 1 as b from t2 ;
573
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
574
577
show create table t1;
577
--error ER_NO_DEFAULT_FOR_FIELD
578
581
create table t1 (
579
a varchar(12) collate utf8_bin not null,
582
a varchar(12) charset utf8 collate utf8_bin not null,
580
583
b int not null, primary key (a)
581
584
) select a, 1 as c from t2 ;
585
show create table t1;
583
589
create table t1 (
584
a varchar(12) collate utf8_bin not null,
590
a varchar(12) charset utf8 collate utf8_bin not null,
585
591
b int null, primary key (a)
586
592
) select a, 1 as c from t2 ;
587
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
588
show create table t1;
592
a varchar(12) collate utf8_bin not null,
593
b int not null, primary key (a)
594
) select 'a' as a , 1 as b from t2 ;
595
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
596
show create table t1;
600
a varchar(12) collate utf8_bin,
601
b int not null, primary key (a)
602
) select 'a' as a , 1 as b from t2 ;
603
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
593
show create table t1;
598
a varchar(12) charset utf8 collate utf8_bin not null,
599
b int not null, primary key (a)
600
) select 'a' as a , 1 as b from t2 ;
601
show create table t1;
606
a varchar(12) charset utf8 collate utf8_bin,
607
b int not null, primary key (a)
608
) select 'a' as a , 1 as b from t2 ;
604
609
show create table t1;
605
610
drop table t1, t2;
663
688
create table t1 select * from t1;
664
689
# Error which happens before select_create::prepare()
665
690
--error ER_CANT_AGGREGATE_2COLLATIONS
666
create table t1 select coalesce('a' collate utf8_swedish_ci,'b' collate utf8_bin);
691
create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
667
692
# Error during table creation
668
693
--error ER_KEY_COLUMN_DOES_NOT_EXITS
669
694
create table t1 (primary key(a)) select "b" as b;
670
695
# Error in select_create::prepare() which is not related to table creation
671
# TODO: This really should be failing...
672
# create table t1 (a int);
673
# --error ER_WRONG_VALUE_COUNT_ON_ROW
674
# create table if not exists t1 select 1 as a, 2 as b;
696
create table t1 (a int);
697
--error ER_WRONG_VALUE_COUNT_ON_ROW
698
create table if not exists t1 select 1 as a, 2 as b;
676
700
# Finally error which happens during insert
677
701
--error ER_DUP_ENTRY
678
702
create table t1 (primary key (a)) (select 1 as a) union all (select 1 as a);
679
703
# What happens if table already exists ?
680
704
create table t1 (i int);
681
# TODO: BUG lp:311045
682
#--error ER_TABLE_EXISTS_ERROR
683
#create table t1 select 1 as i;
705
--error ER_TABLE_EXISTS_ERROR
706
create table t1 select 1 as i;
684
707
create table if not exists t1 select 1 as i;
685
708
select * from t1;
687
709
# Error before select_create::prepare()
688
710
--error ER_CANT_AGGREGATE_2COLLATIONS
689
create table t1 select coalesce('a' collate utf8_swedish_ci,'b' collate utf8_bin);
711
create table t1 select coalesce('a' collate latin1_swedish_ci,'b' collate latin1_bin);
690
713
# Error which happens during insertion of rows
691
# TODO: Bug lp:311072
692
# create table t1 (i int);
693
# alter table t1 add primary key (i);
694
# --error ER_DUP_ENTRY
695
# create table if not exists t1 (select 2 as i) union all (select 2 as i);
714
alter table t1 add primary key (i);
716
create table if not exists t1 (select 2 as i) union all (select 2 as i);
700
721
# Base vs temporary tables dillema (a.k.a. bug#24508 "Inconsistent
738
# CREATE TABLE ... SELECT and LOCK TABLES
740
# There is little sense in using CREATE TABLE ... SELECT under
741
# LOCK TABLES as it mostly does not work. At least we check that
742
# the server doesn't crash, hang and produces sensible errors.
743
# Includes test for bug #20662 "Infinite loop in CREATE TABLE
744
# IF NOT EXISTS ... SELECT with locked tables".
745
create table t1 (i int);
746
insert into t1 values (1), (2);
748
--error ER_TABLE_NOT_LOCKED
749
create table t2 select * from t1;
750
--error ER_TABLE_NOT_LOCKED
751
create table if not exists t2 select * from t1;
753
create table t2 (j int);
755
--error ER_TABLE_NOT_LOCKED
756
create table t2 select * from t1;
757
# This should not be ever allowed as it will undermine
758
# lock-all-at-once approach
759
--error ER_TABLE_NOT_LOCKED
760
create table if not exists t2 select * from t1;
762
lock table t1 read, t2 read;
763
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
764
create table t2 select * from t1;
765
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
766
create table if not exists t2 select * from t1;
768
lock table t1 read, t2 write;
769
--error ER_TABLE_EXISTS_ERROR
770
create table t2 select * from t1;
771
# This is the only case which really works.
772
create table if not exists t2 select * from t1;
777
# OTOH CREATE TEMPORARY TABLE ... SELECT should work
778
# well under LOCK TABLES.
780
create temporary table t2 select * from t1;
781
create temporary table if not exists t2 select * from t1;
717
788
# Bug#21772: can not name a column 'upgrade' when create a table
719
790
create table t1 (upgrade int);
1018
1087
add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
1019
1088
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
1021
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
1022
1090
show create table t1;
1024
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
1025
1092
show create table t1;
1027
1094
# Test the server limits; if any of these pass, all above tests need
1028
1095
# to be rewritten to hit the limit
1030
1097
# Ensure limit is really 64 keys
1031
--error ER_TOO_MANY_KEYS
1032
1099
alter table t1 add key
1033
1100
a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
1034
1101
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
1152
1217
# Test incorrect database names
1155
--error ER_WRONG_DB_NAME
1156
1221
CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1157
--error ER_WRONG_DB_NAME
1158
1223
DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1160
1225
# TODO: enable these tests when RENAME DATABASE is implemented.
1161
# --error ER_BAD_DB_ERROR
1162
1227
# RENAME DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa TO a;
1163
# --error ER_WRONG_DB_NAME
1164
1229
# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1165
1230
# create database mysqltest;
1166
# --error ER_WRONG_DB_NAME
1167
1232
# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1168
1233
# drop database mysqltest;
1170
--error ER_WRONG_DB_NAME
1171
1236
USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1172
#--error ER_WRONG_DB_NAME
1173
1238
SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1176
## Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
1241
# Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
1179
1245
create database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1180
1246
use имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1181
1247
select database();
1184
select SCHEMA_NAME from data_dictionary.schemas
1250
select SCHEMA_NAME from information_schema.schemata
1185
1251
where schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45';
1187
1253
drop database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1191
1257
index имя_индекса_в_кодировке_утф8_длиной_больше_чем_48 (имя_поля_в_кодировке_утф8_длиной_больше_чем_45)
1260
create view имя_вью_кодировке_утф8_длиной_больше_чем_42 as
1261
select имя_поля_в_кодировке_утф8_длиной_больше_чем_45
1262
from имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1195
# database, table, field, key
1264
# database, table, field, key, view
1196
1265
select * from имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1198
select TABLE_NAME from data_dictionary.tables where
1199
table_schema='test';
1201
select COLUMN_NAME from data_dictionary.columns where
1202
table_schema='test';
1204
select INDEX_NAME from data_dictionary.indexes where
1205
table_schema='test';
1207
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
1267
select TABLE_NAME from information_schema.tables where
1268
table_schema='test';
1270
select COLUMN_NAME from information_schema.columns where
1271
table_schema='test';
1273
select INDEX_NAME from information_schema.statistics where
1274
table_schema='test';
1276
select TABLE_NAME from information_schema.views where
1277
table_schema='test';
1208
1279
show create table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1280
show create view имя_вью_кодировке_утф8_длиной_больше_чем_42;
1282
# procedure, function, trigger
1284
create trigger имя_триггера_в_кодировке_утф8_длиной_больше_чем_49
1285
before insert on имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48 for each row set @a:=1;
1286
select TRIGGER_NAME from information_schema.triggers where
1287
trigger_schema='test';
1288
drop trigger имя_триггера_в_кодировке_утф8_длиной_больше_чем_49;
1291
очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66
1292
before insert on имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48 for each row set @a:=1;
1294
drop trigger очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66;
1296
create procedure имя_процедуры_в_кодировке_утф8_длиной_больше_чем_50()
1299
select ROUTINE_NAME from information_schema.routines where
1300
routine_schema='test';
1301
drop procedure имя_процедуры_в_кодировке_утф8_длиной_больше_чем_50;
1303
create procedure очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66()
1307
create function имя_функции_в_кодировке_утф8_длиной_больше_чем_49()
1310
select ROUTINE_NAME from information_schema.routines where
1311
routine_schema='test';
1312
drop function имя_функции_в_кодировке_утф8_длиной_больше_чем_49;
1314
create function очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66()
1318
drop view имя_вью_кодировке_утф8_длиной_больше_чем_42;
1210
1319
drop table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1323
# Bug#21136 CREATE TABLE SELECT within CREATE TABLE SELECT causes server crash
1327
drop table if exists t1,t2,t3;
1328
drop function if exists f1;
1332
create function f1() returns int
1335
create temporary table t3 select 1 i;
1336
set res:= (select count(*) from t1);
1337
drop temporary table t3;
1341
create table t1 as select 1;
1342
create table t2 as select f1() from t1;
1214
1347
# Bug#25629 CREATE TABLE LIKE does not work with INFORMATION_SCHEMA
1216
--error ER_CANT_CREATE_TABLE
1217
create table t1 like data_dictionary.processlist;
1218
create table t1 like data_dictionary.processlist engine=innodb;
1219
show create table t1;
1221
--error ER_CANT_CREATE_TABLE
1222
create temporary table t1 like data_dictionary.processlist;
1223
create temporary table t1 like data_dictionary.processlist engine=myisam;
1349
create table t1 like information_schema.processlist;
1350
show create table t1;
1352
create temporary table t1 like information_schema.processlist;
1353
show create table t1;
1355
create table t1 like information_schema.character_sets;
1224
1356
show create table t1;