36
36
create temporary table t1 (ordid int not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=MEMORY;
37
37
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
38
38
create table not_existing_database.test (a int);
39
ERROR 42000: Unknown database 'not_existing_database'
39
ERROR HY000: Can't create table 'not_existing_database.test' (errno: 2)
40
40
create table `a/a` (a int);
41
41
show create table `a/a`;
107
107
create table t1(x varchar(50) );
108
108
create table t2 select x from t1 where 1=2;
110
Field Type Null Key Default Extra
111
x varchar(50) YES NULL
110
Field Type Null Default Default_is_NULL On_Update
113
Field Type Null Key Default Extra
114
x varchar(50) YES NULL
113
Field Type Null Default Default_is_NULL On_Update
116
116
create table t2 select now() as a , curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;
118
Field Type Null Key Default Extra
122
e decimal(3,1) NO NULL
118
Field Type Null Default Default_is_NULL On_Update
121
d INTEGER FALSE FALSE
122
e DECIMAL FALSE FALSE
125
125
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("2001-12-29 20:45:11" AS DATETIME) as dt;
127
Field Type Null Key Default Extra
127
Field Type Null Default Default_is_NULL On_Update
129
dt DATETIME TRUE TRUE
130
130
drop table t1,t2;
131
131
create table t1 (a int);
132
132
create table t2 (a int) select * from t1;
134
Field Type Null Key Default Extra
134
Field Type Null Default Default_is_NULL On_Update
137
Field Type Null Key Default Extra
137
Field Type Null Default Default_is_NULL On_Update
139
139
drop table if exists t2;
140
140
create table t2 (a int, a float) select * from t1;
141
141
ERROR 42S21: Duplicate column name 'a'
353
353
select * from t2;
355
355
create table t3 like t1;
356
ERROR 42S01: Table 't3' already exists
356
357
create table t3 like mysqltest.t3;
357
358
ERROR 42S01: Table 't3' already exists
358
359
create table non_existing_database.t1 like t1;
359
ERROR 42000: Unknown database 'non_existing_database'
360
ERROR HY000: Can't create table 'non_existing_database.t1' (errno: 2)
360
361
create table t3 like non_existing_table;
361
362
ERROR 42S02: Table 'test.non_existing_table' doesn't exist
362
363
create temporary table t3 like t1;
363
364
ERROR 42S01: Table 't3' already exists
364
365
drop table t1, t2, t3;
366
366
drop database mysqltest;
367
367
SET SESSION storage_engine="MEMORY";
368
368
SELECT @@storage_engine;
418
418
ifnull(h,cast('yet another binary data' as binary)) as h
421
Field Type Null Key Default Extra
426
e varchar(1) YES NULL
421
Field Type Null Default Default_is_NULL On_Update
429
429
select * from t2;
431
431
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 yet another binary data
453
453
create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
454
454
insert into t1 values ('','',0,0.0);
456
Field Type Null Key Default Extra
457
str varchar(10) YES def
458
strnull varchar(10) YES NULL
456
Field Type Null Default Default_is_NULL On_Update
457
str VARCHAR TRUE def FALSE
458
strnull VARCHAR TRUE def TRUE
459
intg INTEGER TRUE 10 FALSE
460
rel DOUBLE TRUE 3.14 FALSE
461
461
create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
463
Field Type Null Key Default Extra
464
str varchar(10) YES NULL
465
strnull varchar(10) YES NULL
463
Field Type Null Default Default_is_NULL On_Update
464
str VARCHAR TRUE TRUE
465
strnull VARCHAR TRUE TRUE
466
intg INTEGER TRUE TRUE
468
468
drop table t1, t2;
469
469
create table t1(name varchar(10), age int default -1);
471
Field Type Null Key Default Extra
472
name varchar(10) YES NULL
471
Field Type Null Default Default_is_NULL On_Update
472
name VARCHAR TRUE TRUE
473
age INTEGER TRUE -1 FALSE
474
474
create table t2(name varchar(10), age int default - 1);
476
Field Type Null Key Default Extra
477
name varchar(10) YES NULL
476
Field Type Null Default Default_is_NULL On_Update
477
name VARCHAR TRUE TRUE
478
age INTEGER TRUE -1 FALSE
479
479
drop table t1, t2;
480
480
create table t1(cenum enum('a'));
481
481
create table t2(cenum enum('a','a'));
522
522
CREATE TABLE t1 (f1 VARCHAR(255));
523
523
CREATE TABLE t2 AS SELECT LEFT(f1,171) AS f2 FROM t1 UNION SELECT LEFT(f1,171) AS f2 FROM t1;
525
Field Type Null Key Default Extra
526
f2 varchar(171) YES NULL
525
Field Type Null Default Default_is_NULL On_Update
527
527
DROP TABLE t1,t2;
528
528
CREATE TABLE t12913 (f1 ENUM ('a','b')) AS SELECT 'a' AS f1;
529
529
SELECT * FROM t12913;
539
539
create database mysqltest;
540
540
create database if not exists mysqltest;
542
Note 1007 Can't create database './mysqltest'; database exists
542
Note 1007 Can't create database 'mysqltest'; database exists
543
543
show create database mysqltest;
544
544
Database Create Database
545
mysqltest CREATE DATABASE `mysqltest`
545
mysqltest CREATE DATABASE `mysqltest` COLLATE = utf8_general_ci
546
546
drop database mysqltest;
548
548
create table t1 (a int);
1355
1355
Handler_read_next 0
1356
1356
Handler_read_prev 0
1357
1357
Handler_read_rnd 0
1358
Handler_read_rnd_next 7
1358
Handler_read_rnd_next 13
1359
1359
drop table t1,t2;
1360
1360
CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1));
1362
1362
CREATE TABLE t1(c1 VARCHAR(33), KEY (c1) USING BTREE);
1364
1364
CREATE TEMPORARY TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1) USING HASH) ENGINE=MEMORY;
1366
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
1367
t1 1 c1 1 c1 NULL 0 NULL NULL YES HASH
1369
1366
CREATE TEMPORARY TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
1371
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
1372
t1 1 c1 1 c1 A NULL NULL NULL YES BTREE
1374
1368
End of 5.0 tests
1375
1369
CREATE TABLE t1 (a int, b int);
1425
1419
table_schema='test';
1427
1421
имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48
1428
select COLUMN_NAME from information_schema.old_columns where
1422
select COLUMN_NAME from data_dictionary.columns where
1429
1423
table_schema='test';
1431
1425
имя_поля_в_кодировке_утф8_длиной_больше_чем_45