39 lines
1.5 KiB
Plaintext
39 lines
1.5 KiB
Plaintext
CREATE TEMPORARY TABLE t1 (f1 int, f2 int primary key, UNIQUE KEY (f1));
|
|
SHOW COLUMNS FROM t1;
|
|
Field Type Null Key Default Extra
|
|
f1 int(11) YES UNI NULL NULL
|
|
f2 int(11) NO PRI NULL NULL
|
|
SHOW INDEXES FROM t1;
|
|
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression
|
|
t1 0 PRIMARY 1 f2 A 0 NULL NULL BTREE YES NULL
|
|
t1 0 f1 1 f1 A 0 NULL NULL YES BTREE YES NULL
|
|
SELECT * FROM information_schema.tmp_tables_columns;
|
|
ERROR 42S02: Unknown table 'TMP_TABLES_COLUMNS' in information_schema
|
|
SELECT * FROM information_schema.tmp_tables_keys;
|
|
ERROR 42S02: Unknown table 'TMP_TABLES_KEYS' in information_schema
|
|
DROP TEMPORARY TABLE t1;
|
|
CREATE TABLE t1 (f1 int);
|
|
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE
|
|
FROM information_schema.tables WHERE table_name='t1';
|
|
TABLE_SCHEMA TABLE_NAME TABLE_TYPE
|
|
test t1 BASE TABLE
|
|
LOCK TABLE t1 READ;
|
|
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE
|
|
FROM information_schema.tables WHERE table_name='t1';
|
|
TABLE_SCHEMA TABLE_NAME TABLE_TYPE
|
|
test t1 BASE TABLE
|
|
PREPARE st2 FROM
|
|
"SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE FROM
|
|
information_schema.tables WHERE table_name='t1'";
|
|
EXECUTE st2;
|
|
TABLE_SCHEMA TABLE_NAME TABLE_TYPE
|
|
test t1 BASE TABLE
|
|
DEALLOCATE PREPARE st2;
|
|
UNLOCK TABLES;
|
|
DROP TABLE t1;
|
|
CREATE DATABASE abc;
|
|
CREATE TABLE abc.memorytable (id INT NOT NULL) ENGINE=MEMORY;
|
|
# restart
|
|
SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'abc';
|
|
DROP DATABASE abc;
|