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
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;
386
--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;
387
371
show create table t2;
388
372
drop table t1,t2;
411
395
# test for bug #1427 "enum allows duplicate values in the list"
414
create table t1(cenum enum('a'));
415
--error ER_DUPLICATED_VALUE_IN_TYPE
416
create table t2(cenum enum('a','a'));
417
--error ER_DUPLICATED_VALUE_IN_TYPE
418
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;
427
409
select database();
428
410
drop database mysqltest;
429
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;
433
424
# Test for Bug 856 'Naming a key "Primary" causes trouble'
436
## TODO: Is this really a bug? It works in Drizzle. Should it?
437
#--error ER_WRONG_NAME_FOR_INDEX
438
#create table t1 (a int, index `primary` (a));
439
#--error ER_WRONG_NAME_FOR_INDEX
440
#create table t1 (a int, index `PRIMARY` (a));
442
#create table t1 (`primary` int, index(`primary`));
443
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
444
#show create table t1;
445
#create table t2 (`PRIMARY` int, index(`PRIMARY`));
446
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
447
#show create table t2;
449
#create table t3 (a int);
450
#--error ER_WRONG_NAME_FOR_INDEX
451
#alter table t3 add index `primary` (a);
452
#--error ER_WRONG_NAME_FOR_INDEX
453
#alter table t3 add index `PRIMARY` (a);
455
#create table t4 (`primary` int);
456
#alter table t4 add index(`primary`);
457
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
458
#show create table t4;
459
#create table t5 (`PRIMARY` int);
460
#alter table t5 add index(`PRIMARY`);
461
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
462
#show create table t5;
464
#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;
467
453
# bug #3266 TEXT in CREATE TABLE SELECT
560
565
# calculation of number of NULLs.
562
567
CREATE TABLE t2 (
568
a int(11) default NULL
565
570
insert into t2 values(111);
568
573
create table t1 (
569
a varchar(12) collate utf8_bin not null,
574
a varchar(12) charset utf8 collate utf8_bin not null,
570
575
b int not null, primary key (a)
571
576
) select a, 1 as b from t2 ;
572
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
573
577
show create table t1;
576
--error ER_NO_DEFAULT_FOR_FIELD
577
581
create table t1 (
578
a varchar(12) collate utf8_bin not null,
582
a varchar(12) charset utf8 collate utf8_bin not null,
579
583
b int not null, primary key (a)
580
584
) select a, 1 as c from t2 ;
585
show create table t1;
582
589
create table t1 (
583
a varchar(12) collate utf8_bin not null,
590
a varchar(12) charset utf8 collate utf8_bin not null,
584
591
b int null, primary key (a)
585
592
) select a, 1 as c from t2 ;
586
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
587
show create table t1;
591
a varchar(12) collate utf8_bin not null,
592
b int not null, primary key (a)
593
) select 'a' as a , 1 as b from t2 ;
594
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
595
show create table t1;
599
a varchar(12) collate utf8_bin,
600
b int not null, primary key (a)
601
) select 'a' as a , 1 as b from t2 ;
602
--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 ;
603
609
show create table t1;
604
610
drop table t1, t2;
662
688
create table t1 select * from t1;
663
689
# Error which happens before select_create::prepare()
664
690
--error ER_CANT_AGGREGATE_2COLLATIONS
665
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);
666
692
# Error during table creation
667
693
--error ER_KEY_COLUMN_DOES_NOT_EXITS
668
694
create table t1 (primary key(a)) select "b" as b;
669
695
# Error in select_create::prepare() which is not related to table creation
670
# TODO: This really should be failing...
671
# create table t1 (a int);
672
# --error ER_WRONG_VALUE_COUNT_ON_ROW
673
# 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;
675
700
# Finally error which happens during insert
676
701
--error ER_DUP_ENTRY
677
702
create table t1 (primary key (a)) (select 1 as a) union all (select 1 as a);
678
703
# What happens if table already exists ?
679
704
create table t1 (i int);
680
# TODO: BUG lp:311045
681
#--error ER_TABLE_EXISTS_ERROR
682
#create table t1 select 1 as i;
705
--error ER_TABLE_EXISTS_ERROR
706
create table t1 select 1 as i;
683
707
create table if not exists t1 select 1 as i;
684
708
select * from t1;
686
709
# Error before select_create::prepare()
687
710
--error ER_CANT_AGGREGATE_2COLLATIONS
688
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);
689
713
# Error which happens during insertion of rows
690
# TODO: Bug lp:311072
691
# create table t1 (i int);
692
# alter table t1 add primary key (i);
693
# --error ER_DUP_ENTRY
694
# 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);
699
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;
716
788
# Bug#21772: can not name a column 'upgrade' when create a table
718
790
create table t1 (upgrade int);
1017
1087
add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
1018
1088
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
1020
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
1021
1090
show create table t1;
1023
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
1024
1092
show create table t1;
1026
1094
# Test the server limits; if any of these pass, all above tests need
1027
1095
# to be rewritten to hit the limit
1029
1097
# Ensure limit is really 64 keys
1030
--error ER_TOO_MANY_KEYS
1031
1099
alter table t1 add key
1032
1100
a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
1033
1101
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
1151
1217
# Test incorrect database names
1154
--error ER_WRONG_DB_NAME
1155
1221
CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1156
--error ER_WRONG_DB_NAME
1157
1223
DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1159
1225
# TODO: enable these tests when RENAME DATABASE is implemented.
1160
# --error ER_BAD_DB_ERROR
1161
1227
# RENAME DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa TO a;
1162
# --error ER_WRONG_DB_NAME
1163
1229
# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1164
1230
# create database mysqltest;
1165
# --error ER_WRONG_DB_NAME
1166
1232
# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1167
1233
# drop database mysqltest;
1169
--error ER_WRONG_DB_NAME
1170
1236
USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1171
--error ER_WRONG_DB_NAME
1172
1238
SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1175
## 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
1178
1245
create database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1179
1246
use имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1180
1247
select database();
1183
select SCHEMA_NAME from data_dictionary.schemas
1250
select SCHEMA_NAME from information_schema.schemata
1184
1251
where schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45';
1186
1253
drop database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1190
1257
index имя_индекса_в_кодировке_утф8_длиной_больше_чем_48 (имя_поля_в_кодировке_утф8_длиной_больше_чем_45)
1260
create view имя_вью_кодировке_утф8_длиной_больше_чем_42 as
1261
select имя_поля_в_кодировке_утф8_длиной_больше_чем_45
1262
from имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1194
# database, table, field, key
1264
# database, table, field, key, view
1195
1265
select * from имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1197
select TABLE_NAME from data_dictionary.tables where
1198
table_schema='test';
1200
select COLUMN_NAME from data_dictionary.columns where
1201
table_schema='test';
1203
select INDEX_NAME from data_dictionary.indexes where
1204
table_schema='test';
1206
--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';
1207
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;
1209
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;
1213
1347
# Bug#25629 CREATE TABLE LIKE does not work with INFORMATION_SCHEMA
1215
--error ER_CANT_CREATE_TABLE
1216
create table t1 like data_dictionary.processlist;
1217
create table t1 like data_dictionary.processlist engine=innodb;
1218
show create table t1;
1220
--error ER_CANT_CREATE_TABLE
1221
create temporary table t1 like data_dictionary.processlist;
1222
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;
1223
1356
show create table t1;