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_TABLE_UNKNOWN
30
create temporary table t2 engine=MEMORY select * from t1;
31
--error ER_TABLE_UNKNOWN
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;
43
43
create table not_existing_database.test (a int);
44
44
create table `a/a` (a int);
45
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
46
45
show create table `a/a`;
47
46
create table t1 like `a/a`;
48
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
50
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
51
show create table `t1`;
54
--error ER_WRONG_TABLE_NAME
55
50
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);
56
--error ER_TOO_LONG_IDENT
57
52
create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int);
60
55
# Some wrong defaults, so these creates should fail too (Bug #5902)
62
--error ER_INVALID_DEFAULT
63
58
create table t1 (a datetime default now());
64
--error ER_INVALID_ON_UPDATE
65
60
create table t1 (a datetime on update now());
66
--error ER_INVALID_DEFAULT
67
62
create table t1 (a int default 100 auto_increment);
68
# TODO: Should this really fail? What's wrong with default 1000 ???
69
#--error ER_INVALID_DEFAULT
70
#create table t1 (a int default 1000);
71
--error ER_INVALID_DEFAULT
64
create table t1 (a int default 1000);
72
66
create table t1 (a varchar(5) default 'abcdef');
74
68
create table t1 (a varchar(5) default 'abcde');
75
69
insert into t1 values();
77
--error ER_INVALID_DEFAULT
78
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;
318
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
319
300
show create table t3;
321
301
create table t2 like t3;
323
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
324
302
show create table t2;
325
303
select * from t2;
327
--error ER_TABLE_EXISTS_ERROR
328
304
create table t3 like t1;
330
--error ER_TABLE_EXISTS_ERROR
331
306
create table t3 like mysqltest.t3;
333
--error ER_BAD_DB_ERROR
334
308
create table non_existing_database.t1 like t1;
336
--error ER_TABLE_UNKNOWN
337
create table t4 like non_existing_table;
339
--error ER_TABLE_EXISTS_ERROR
309
--error ER_NO_SUCH_TABLE
310
create table t3 like non_existing_table;
340
312
create temporary table t3 like t1;
341
313
drop table t1, t2, t3;
342
315
drop database mysqltest;
345
318
# Test default table type
347
SET SESSION storage_engine="MEMORY";
320
SET SESSION storage_engine="heap";
348
321
SELECT @@storage_engine;
349
CREATE TEMPORARY TABLE t1 (a int not null);
322
CREATE TABLE t1 (a int not null);
350
323
show create table t1;
352
--error ER_UNKNOWN_STORAGE_ENGINE
353
326
SET SESSION storage_engine="gemini";
354
327
SELECT @@storage_engine;
355
CREATE TEMPORARY TABLE t1 (a int not null);
328
CREATE TABLE t1 (a int not null);
356
329
show create table t1;
357
330
SET SESSION storage_engine=default;
361
334
# Test types of data for create select with functions
364
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);
365
338
insert into t1(a)values(1);
366
insert into t1(a,b,c,d,e,f,h)
367
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');
368
341
select * from t1;
343
ifnull(b,cast(-7 as signed)) as b,
344
ifnull(c,cast(7 as)) as c,
372
345
ifnull(d,cast('2000-01-01' as date)) as d,
373
346
ifnull(e,cast('b' as char)) as e,
374
347
ifnull(f,cast('2000-01-01' as datetime)) as f,
375
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,
383
358
ifnull(d,cast('2000-01-01' as date)) as d,
384
359
ifnull(e,cast('b' as char)) as e,
385
360
ifnull(f,cast('2000-01-01' as datetime)) as f,
386
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
389
366
select * from t2;
390
367
drop table t1, t2;
392
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));
393
SHOW CREATE TABLE t1;
394
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;
395
--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;
396
371
show create table t2;
397
372
drop table t1,t2;
420
395
# test for bug #1427 "enum allows duplicate values in the list"
423
create table t1(cenum enum('a'));
424
--error ER_DUPLICATED_VALUE_IN_TYPE
425
create table t2(cenum enum('a','a'));
426
--error ER_DUPLICATED_VALUE_IN_TYPE
427
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;
436
409
select database();
437
410
drop database mysqltest;
438
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;
442
424
# Test for Bug 856 'Naming a key "Primary" causes trouble'
445
## TODO: Is this really a bug? It works in Drizzle. Should it?
446
#--error ER_WRONG_NAME_FOR_INDEX
447
#create table t1 (a int, index `primary` (a));
448
#--error ER_WRONG_NAME_FOR_INDEX
449
#create table t1 (a int, index `PRIMARY` (a));
451
#create table t1 (`primary` int, index(`primary`));
452
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
453
#show create table t1;
454
#create table t2 (`PRIMARY` int, index(`PRIMARY`));
455
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
456
#show create table t2;
458
#create table t3 (a int);
459
#--error ER_WRONG_NAME_FOR_INDEX
460
#alter table t3 add index `primary` (a);
461
#--error ER_WRONG_NAME_FOR_INDEX
462
#alter table t3 add index `PRIMARY` (a);
464
#create table t4 (`primary` int);
465
#alter table t4 add index(`primary`);
466
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
467
#show create table t4;
468
#create table t5 (`PRIMARY` int);
469
#alter table t5 add index(`PRIMARY`);
470
#--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
471
#show create table t5;
473
#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;
476
453
# bug #3266 TEXT in CREATE TABLE SELECT
569
565
# calculation of number of NULLs.
571
567
CREATE TABLE t2 (
568
a int(11) default NULL
574
570
insert into t2 values(111);
577
573
create table t1 (
578
a varchar(12) collate utf8_bin not null,
574
a varchar(12) charset utf8 collate utf8_bin not null,
579
575
b int not null, primary key (a)
580
576
) select a, 1 as b from t2 ;
581
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
582
577
show create table t1;
585
--error ER_NO_DEFAULT_FOR_FIELD
586
581
create table t1 (
587
a varchar(12) collate utf8_bin not null,
582
a varchar(12) charset utf8 collate utf8_bin not null,
588
583
b int not null, primary key (a)
589
584
) select a, 1 as c from t2 ;
585
show create table t1;
591
589
create table t1 (
592
a varchar(12) collate utf8_bin not null,
590
a varchar(12) charset utf8 collate utf8_bin not null,
593
591
b int null, primary key (a)
594
592
) select a, 1 as c from t2 ;
595
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
596
show create table t1;
600
a varchar(12) collate utf8_bin not null,
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/
604
show create table t1;
608
a varchar(12) collate utf8_bin,
609
b int not null, primary key (a)
610
) select 'a' as a , 1 as b from t2 ;
611
--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 ;
612
609
show create table t1;
613
610
drop table t1, t2;
664
681
# of error it is automatically dropped if it has not existed before.)
666
683
# Error during open_and_lock_tables() of tables
667
--error ER_TABLE_UNKNOWN
684
--error ER_NO_SUCH_TABLE
668
685
create table t1 select * from t2;
669
686
# Rather special error which also caught during open tables pahse
670
687
--error ER_UPDATE_TABLE_USED
671
688
create table t1 select * from t1;
672
689
# Error which happens before select_create::prepare()
673
690
--error ER_CANT_AGGREGATE_2COLLATIONS
674
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);
675
692
# Error during table creation
676
693
--error ER_KEY_COLUMN_DOES_NOT_EXITS
677
694
create table t1 (primary key(a)) select "b" as b;
678
695
# Error in select_create::prepare() which is not related to table creation
679
# TODO: This really should be failing...
680
# create table t1 (a int);
681
# --error ER_WRONG_VALUE_COUNT_ON_ROW
682
# 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;
684
700
# Finally error which happens during insert
685
701
--error ER_DUP_ENTRY
686
702
create table t1 (primary key (a)) (select 1 as a) union all (select 1 as a);
687
703
# What happens if table already exists ?
688
704
create table t1 (i int);
689
# TODO: BUG lp:311045
690
#--error ER_TABLE_EXISTS_ERROR
691
#create table t1 select 1 as i;
705
--error ER_TABLE_EXISTS_ERROR
706
create table t1 select 1 as i;
692
707
create table if not exists t1 select 1 as i;
693
708
select * from t1;
695
709
# Error before select_create::prepare()
696
710
--error ER_CANT_AGGREGATE_2COLLATIONS
697
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);
698
713
# Error which happens during insertion of rows
699
# TODO: Bug lp:311072
700
# create table t1 (i int);
701
# alter table t1 add primary key (i);
702
# --error ER_DUP_ENTRY
703
# 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);
708
721
# Base vs temporary tables dillema (a.k.a. bug#24508 "Inconsistent
715
728
create table if not exists t1 select 1;
716
729
select * from t1;
717
730
drop temporary table t1;
718
--error ER_TABLE_UNKNOWN
731
--error ER_NO_SUCH_TABLE
719
732
select * from t1;
720
733
--error ER_BAD_TABLE_ERROR
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;
725
788
# Bug#21772: can not name a column 'upgrade' when create a table
727
790
create table t1 (upgrade int);
1026
1087
add key a064_long_123456789_123456789_123456789_123456789_123456789_1234 (
1027
1088
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
1029
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
1030
1090
show create table t1;
1032
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
1033
1092
show create table t1;
1035
1094
# Test the server limits; if any of these pass, all above tests need
1036
1095
# to be rewritten to hit the limit
1038
1097
# Ensure limit is really 64 keys
1039
--error ER_TOO_MANY_KEYS
1040
1099
alter table t1 add key
1041
1100
a065_long_123456789_123456789_123456789_123456789_123456789_1234 (
1042
1101
c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16);
1160
1217
# Test incorrect database names
1163
--error ER_WRONG_DB_NAME
1164
1221
CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1165
--error ER_WRONG_DB_NAME
1166
1223
DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1168
1225
# TODO: enable these tests when RENAME DATABASE is implemented.
1169
# --error ER_BAD_DB_ERROR
1170
1227
# RENAME DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa TO a;
1171
# --error ER_WRONG_DB_NAME
1172
1229
# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1173
1230
# create database mysqltest;
1174
# --error ER_WRONG_DB_NAME
1175
1232
# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1176
1233
# drop database mysqltest;
1178
--error ER_WRONG_DB_NAME
1179
1236
USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1180
#--error ER_WRONG_DB_NAME
1181
1238
SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
1184
## 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
1187
1245
create database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1188
1246
use имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1189
1247
select database();
1192
select SCHEMA_NAME from data_dictionary.schemas
1250
select SCHEMA_NAME from information_schema.schemata
1193
1251
where schema_name='имя_базы_в_кодировке_утф8_длиной_больше_чем_45';
1195
1253
drop database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
1199
1257
index имя_индекса_в_кодировке_утф8_длиной_больше_чем_48 (имя_поля_в_кодировке_утф8_длиной_больше_чем_45)
1260
create view имя_вью_кодировке_утф8_длиной_больше_чем_42 as
1261
select имя_поля_в_кодировке_утф8_длиной_больше_чем_45
1262
from имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1203
# database, table, field, key
1264
# database, table, field, key, view
1204
1265
select * from имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1206
select TABLE_NAME from data_dictionary.tables where
1207
table_schema='test';
1209
select COLUMN_NAME from data_dictionary.columns where
1210
table_schema='test';
1212
select INDEX_NAME from data_dictionary.indexes where
1213
table_schema='test';
1215
--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';
1216
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;
1218
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;
1222
1347
# Bug#25629 CREATE TABLE LIKE does not work with INFORMATION_SCHEMA
1224
--error ER_CANT_CREATE_TABLE,ER_TABLE_PERMISSION_DENIED
1225
create table t1 like data_dictionary.processlist;
1226
create table t1 like data_dictionary.processlist engine=innodb;
1227
show create table t1;
1229
--error ER_CANT_CREATE_TABLE,ER_TABLE_PERMISSION_DENIED
1230
create temporary table t1 like data_dictionary.processlist;
1231
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;
1232
1356
show create table t1;