28
28
select * from data_dictionary.columns where table_name="t1"
29
29
and column_name= "a";
30
TABLE_SCHEMA TABLE_NAME COLUMN_NAME COLUMN_TYPE ORDINAL_POSITION COLUMN_DEFAULT COLUMN_DEFAULT_IS_NULL COLUMN_DEFAULT_UPDATE IS_SIGNED IS_AUTO_INCREMENT IS_NULLABLE IS_INDEXED IS_USED_IN_PRIMARY IS_UNIQUE IS_MULTI IS_FIRST_IN_MULTI INDEXES_FOUND_IN DATA_TYPE DATA_ARCHETYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE ENUM_VALUES COLLATION_NAME COLUMN_COMMENT
31
mysqltest t1 a INTEGER 0 NULL YES NULL NO YES NO NO NO NO NO 0 INTEGER INTEGER 0 0 0 0 NULL NULL
30
TABLE_SCHEMA TABLE_NAME COLUMN_NAME COLUMN_TYPE ORDINAL_POSITION COLUMN_DEFAULT COLUMN_DEFAULT_IS_NULL COLUMN_DEFAULT_UPDATE IS_AUTO_INCREMENT IS_NULLABLE IS_INDEXED IS_USED_IN_PRIMARY IS_UNIQUE IS_MULTI IS_FIRST_IN_MULTI INDEXES_FOUND_IN DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE ENUM_VALUES COLLATION_NAME COLUMN_COMMENT
31
mysqltest t1 a INTEGER 0 NULL YES NO YES NO NO NO NO NO 0 INTEGER 0 0 0 0 NULL NULL
32
32
select table_name, column_name from data_dictionary.columns
33
33
where table_schema = 'mysqltest' and table_name = 't1';
34
34
table_name column_name
100
100
where table_name='t1';
101
101
column_name data_type CHARACTER_OCTET_LENGTH CHARACTER_MAXIMUM_LENGTH
105
105
create table t1(f1 int, f2 int, f3 BIGINT, f4 int,
106
106
f5 BIGINT, f6 int, f7 int);
187
187
AND t.table_name NOT LIKE 'falcon%'
188
188
ORDER BY t.table_name, c1.column_name;
189
189
table_name column_name
190
CATALOGS CATALOG_CREATION_TIME
191
190
CHARACTER_SETS DEFAULT_COLLATE_NAME
192
191
COLLATIONS COLLATION_NAME
193
192
COLUMNS TABLE_SCHEMA
194
193
CUMULATIVE_SQL_COMMANDS COUNT_SELECT
195
194
CUMULATIVE_USER_STATS BYTES_RECEIVED
196
195
CURRENT_SQL_COMMANDS IP
196
DRIZZLE_PROTOCOL_STATUS VARIABLE_VALUE
198
197
FOREIGN_KEYS CONSTRAINT_SCHEMA
199
198
GLOBAL_STATEMENTS VARIABLE_VALUE
200
199
GLOBAL_STATUS VARIABLE_VALUE
202
201
INDEXES TABLE_SCHEMA
203
202
INDEX_PARTS TABLE_SCHEMA
204
203
INNODB_CMP COMPRESS_OPS
205
INNODB_CMPMEM PAGE_SIZE
206
INNODB_CMPMEM_RESET PAGE_SIZE
204
INNODB_CMPMEM PAGES_USED
205
INNODB_CMPMEM_RESET PAGES_USED
207
206
INNODB_CMP_RESET COMPRESS_OPS
208
207
INNODB_LOCKS LOCK_TRX_ID
209
208
INNODB_LOCK_WAITS REQUESTED_LOCK_ID
210
INNODB_REPLICATION_LOG TRANSACTION_SEGMENT_ID
211
209
INNODB_STATUS VARIABLE_VALUE
212
INNODB_SYS_COLUMNS NAME
213
INNODB_SYS_FIELDS NAME
214
INNODB_SYS_FOREIGN FOR_NAME
215
INNODB_SYS_FOREIGN_COLS FOR_COL_NAME
216
INNODB_SYS_INDEXES NAME
217
INNODB_SYS_TABLES NAME
218
INNODB_SYS_TABLESTATS NAME
219
210
INNODB_TRX TRX_STATE
220
211
MODULES MODULE_VERSION
212
MYSQL_PROTOCOL_STATUS VARIABLE_VALUE
221
213
PLUGINS PLUGIN_TYPE
223
PROTOCOL_COUNTERS COUNTER
224
215
REPLICATION_STREAMS APPLIER
225
216
SCHEMAS SCHEMA_NAME
217
SCHEMA_SQL_DEFINITION SCHEMA_NAME
226
218
SCOREBOARD_STATISTICS NUMBER_OF_RANGE_LOCKS
227
219
SESSION_STATEMENTS VARIABLE_VALUE
228
220
SESSION_STATUS VARIABLE_VALUE
229
221
SESSION_VARIABLES VARIABLE_VALUE
230
SYS_REPLICATION_LOG SEGID
224
SHOW_SCHEMAS SCHEMA_NAME
225
SHOW_TABLE_STATUS Schema
226
SHOW_TEMPORARY_TABLES TABLE_SCHEMA
231
227
TABLES TABLE_SCHEMA
232
228
TABLE_CACHE TABLE_SCHEMA
233
229
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
234
230
TABLE_DEFINITION_CACHE TABLE_SCHEMA
235
USER_DEFINED_BARRIERS SESSION_ID
236
USER_DEFINED_LOCKS SESSION_ID
237
USER_DEFINED_VARIABLES VARIABLE_VALUE
231
TABLE_SQL_DEFINITION TABLE_SQL_DEFINITION
232
USER_LOCKS SESSION_ID
238
233
SELECT t.table_name, c1.column_name
239
234
FROM data_dictionary.tables t
252
247
AND t.table_name NOT LIKE 'falcon%'
253
248
ORDER BY t.table_name, c1.column_name;
254
249
table_name column_name
255
CATALOGS CATALOG_CREATION_TIME
256
250
CHARACTER_SETS DEFAULT_COLLATE_NAME
257
251
COLLATIONS COLLATION_NAME
258
252
COLUMNS TABLE_SCHEMA
259
253
CUMULATIVE_SQL_COMMANDS COUNT_SELECT
260
254
CUMULATIVE_USER_STATS BYTES_RECEIVED
261
255
CURRENT_SQL_COMMANDS IP
256
DRIZZLE_PROTOCOL_STATUS VARIABLE_VALUE
263
257
FOREIGN_KEYS CONSTRAINT_SCHEMA
264
258
GLOBAL_STATEMENTS VARIABLE_VALUE
265
259
GLOBAL_STATUS VARIABLE_VALUE
267
261
INDEXES TABLE_SCHEMA
268
262
INDEX_PARTS TABLE_SCHEMA
269
263
INNODB_CMP COMPRESS_OPS
270
INNODB_CMPMEM PAGE_SIZE
271
INNODB_CMPMEM_RESET PAGE_SIZE
264
INNODB_CMPMEM PAGES_USED
265
INNODB_CMPMEM_RESET PAGES_USED
272
266
INNODB_CMP_RESET COMPRESS_OPS
273
267
INNODB_LOCKS LOCK_TRX_ID
274
268
INNODB_LOCK_WAITS REQUESTED_LOCK_ID
275
INNODB_REPLICATION_LOG TRANSACTION_SEGMENT_ID
276
269
INNODB_STATUS VARIABLE_VALUE
277
INNODB_SYS_COLUMNS NAME
278
INNODB_SYS_FIELDS NAME
279
INNODB_SYS_FOREIGN FOR_NAME
280
INNODB_SYS_FOREIGN_COLS FOR_COL_NAME
281
INNODB_SYS_INDEXES NAME
282
INNODB_SYS_TABLES NAME
283
INNODB_SYS_TABLESTATS NAME
284
270
INNODB_TRX TRX_STATE
285
271
MODULES MODULE_VERSION
272
MYSQL_PROTOCOL_STATUS VARIABLE_VALUE
286
273
PLUGINS PLUGIN_TYPE
288
PROTOCOL_COUNTERS COUNTER
289
275
REPLICATION_STREAMS APPLIER
290
276
SCHEMAS SCHEMA_NAME
277
SCHEMA_SQL_DEFINITION SCHEMA_NAME
291
278
SCOREBOARD_STATISTICS NUMBER_OF_RANGE_LOCKS
292
279
SESSION_STATEMENTS VARIABLE_VALUE
293
280
SESSION_STATUS VARIABLE_VALUE
294
281
SESSION_VARIABLES VARIABLE_VALUE
295
SYS_REPLICATION_LOG SEGID
284
SHOW_SCHEMAS SCHEMA_NAME
285
SHOW_TABLE_STATUS Schema
286
SHOW_TEMPORARY_TABLES TABLE_SCHEMA
296
287
TABLES TABLE_SCHEMA
297
288
TABLE_CACHE TABLE_SCHEMA
298
289
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
299
290
TABLE_DEFINITION_CACHE TABLE_SCHEMA
300
USER_DEFINED_BARRIERS SESSION_ID
301
USER_DEFINED_LOCKS SESSION_ID
302
USER_DEFINED_VARIABLES VARIABLE_VALUE
291
TABLE_SQL_DEFINITION TABLE_SQL_DEFINITION
292
USER_LOCKS SESSION_ID
303
293
SELECT MAX(table_name) FROM data_dictionary.tables;
313
303
create table t2 (f1 int, f2 int);
314
304
drop table t1,t2;
315
305
select 1 as f1 from data_dictionary.tables where "CHARACTER_SETS"=
316
(select cast(table_name as char) from data_dictionary.tables WHERE TABLE_SCHEMA=schema()
317
AND TABLE_NAME = "CHARACTER_SETS"
318
order by table_name limit 1) AND TABLE_SCHEMA=schema() limit 1;
306
(select cast(table_name as char) from data_dictionary.tables
307
order by table_name limit 1) limit 1;
320
310
select t.table_name, group_concat(t.table_schema, '.', t.table_name),
322
312
from data_dictionary.tables t