19
19
create temporary table t1 (a int not null auto_increment,primary key (a)) engine=MEMORY;
21
21
create temporary table t2 engine=MEMORY select * from t1;
22
ERROR 42S02: Unknown table 'test.t1'
22
ERROR 42S02: Table 'test.t1' doesn't exist
23
23
create table t2 select auto+1 from t1;
24
ERROR 42S02: Unknown table 'test.t1'
24
ERROR 42S02: Table 'test.t1' doesn't exist
25
25
drop table if exists t1,t2;
27
27
Note 1051 Unknown table 't1'
280
280
Level Code Message
281
281
Note 1050 Table 't1' already exists
282
282
Error 1062 Duplicate entry '3' for key 'PRIMARY'
283
select * from DATA_DICTIONARY.TABLE_DEFINITION_CACHE WHERE TABLE_COUNT AND TABLE_SCHEMA = SCHEMA() > 1 ORDER BY TABLE_SCHEMA, TABLE_NAME;
283
select * from DATA_DICTIONARY.TABLE_DEFINITION_CACHE WHERE TABLE_COUNT > 1 ORDER BY TABLE_SCHEMA, TABLE_NAME;
284
284
TABLE_SCHEMA TABLE_NAME VERSION TABLE_COUNT IS_NAME_LOCKED
285
285
select * from t1;
362
362
select * from t2;
364
364
create table t3 like t1;
365
ERROR 42S01: Table 'test.t3' already exists
365
ERROR 42S01: Table 't3' already exists
366
366
create table t3 like mysqltest.t3;
367
ERROR 42S01: Table 'test.t3' already exists
367
ERROR 42S01: Table 't3' already exists
368
368
create table non_existing_database.t1 like t1;
369
369
ERROR 42000: Unknown schema 'non_existing_database'
370
create table t4 like non_existing_table;
371
ERROR 42S02: Unknown table 'test.non_existing_table'
370
create table t3 like non_existing_table;
371
ERROR 42S02: Table 'test.non_existing_table' doesn't exist
372
372
create temporary table t3 like t1;
373
ERROR 42S01: Table 'test.#t3' already exists
373
ERROR 42S01: Table 't3' already exists
374
374
drop table t1, t2, t3;
375
375
drop database mysqltest;
376
376
SET SESSION storage_engine="MEMORY";
682
682
) ENGINE=DEFAULT COLLATE = utf8_general_ci
683
683
drop table t1, t2;
684
684
create table t1 select * from t2;
685
ERROR 42S02: Unknown table 'test.t2'
685
ERROR 42S02: Table 'test.t2' doesn't exist
686
686
create table t1 select * from t1;
687
687
ERROR HY000: You can't specify target table 't1' for update in FROM clause
688
688
create table t1 select coalesce('a' collate utf8_swedish_ci,'b' collate utf8_bin);
1460
1460
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1461
1461
drop table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1462
1462
create table t1 like data_dictionary.processlist;
1463
Got one of the listed errors
1463
ERROR HY000: Can't create table 'test.t1' (errno: 1)
1464
1464
create table t1 like data_dictionary.processlist engine=innodb;
1465
1465
show create table t1;
1466
1466
Table Create Table
1467
1467
t1 CREATE TABLE `t1` (
1468
1468
`ID` BIGINT NOT NULL,
1469
`USERNAME` VARCHAR(16) NOT NULL,
1469
`USER` VARCHAR(16) NOT NULL,
1470
1470
`HOST` VARCHAR(1025) NOT NULL,
1471
1471
`DB` VARCHAR(256) DEFAULT NULL,
1472
1472
`COMMAND` VARCHAR(16) NOT NULL,
1473
1473
`TIME` BIGINT UNSIGNED NOT NULL,
1474
1474
`STATE` VARCHAR(256) DEFAULT NULL,
1475
1475
`INFO` VARCHAR(100) DEFAULT NULL,
1476
`HAS_GLOBAL_LOCK` BOOLEAN NOT NULL
1476
`HAS_GLOBAL_LOCK` VARCHAR(5) NOT NULL
1477
1477
) ENGINE=InnoDB COLLATE = utf8_general_ci
1479
1479
create temporary table t1 like data_dictionary.processlist;
1480
Got one of the listed errors
1480
ERROR HY000: Can't create table 'test.#t1' (errno: 138)
1481
1481
create temporary table t1 like data_dictionary.processlist engine=myisam;
1482
1482
show create table t1;
1483
1483
Table Create Table
1484
1484
t1 CREATE TEMPORARY TABLE `t1` (
1485
1485
`ID` BIGINT NOT NULL,
1486
`USERNAME` VARCHAR(16) NOT NULL,
1486
`USER` VARCHAR(16) NOT NULL,
1487
1487
`HOST` VARCHAR(1025) NOT NULL,
1488
1488
`DB` VARCHAR(256) DEFAULT NULL,
1489
1489
`COMMAND` VARCHAR(16) NOT NULL,
1490
1490
`TIME` BIGINT UNSIGNED NOT NULL,
1491
1491
`STATE` VARCHAR(256) DEFAULT NULL,
1492
1492
`INFO` VARCHAR(100) DEFAULT NULL,
1493
`HAS_GLOBAL_LOCK` BOOLEAN NOT NULL
1493
`HAS_GLOBAL_LOCK` VARCHAR(5) NOT NULL
1494
1494
) ENGINE=MyISAM COLLATE = utf8_general_ci