36
36
# test t5 STANDARD PBXT # # # # #
37
37
show columns from t3 like "a%";
38
38
Field Type Null Default Default_is_NULL On_Update
40
40
select * from data_dictionary.COLUMNS where table_name="t1"
41
41
and column_name= "a";
42
42
TABLE_SCHEMA TABLE_NAME COLUMN_NAME COLUMN_TYPE ORDINAL_POSITION COLUMN_DEFAULT COLUMN_DEFAULT_IS_NULL COLUMN_DEFAULT_UPDATE 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 COLLATION_NAME COLUMN_COMMENT
43
mysqltest t1 a INTEGER 0 NULL TRUE TRUE FALSE FALSE FALSE FALSE FALSE 0 INTEGER 0 0 0 0
43
mysqltest t1 a INTEGER 0 NULL YES YES NO NO NO NO NO 0 INTEGER 0 0 0 0 NULL
44
44
select table_name, column_name from data_dictionary.columns
45
45
where table_schema = 'mysqltest' and table_name = 't1';
46
46
table_name column_name
140
140
select column_name, column_default,column_default_is_null from columns
141
141
where table_schema='test' and table_name='t1';
142
142
column_name column_default column_default_is_null
146
146
show columns from t1;
147
147
Field Type Null Default Default_is_NULL On_Update
148
a INTEGER FALSE FALSE
151
151
alter database data_dictionary;
152
152
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near '' at line 1
169
169
create temporary table t1(f1 int, index(f1));
170
170
show columns from t1;
171
171
Field Type Null Default Default_is_NULL On_Update
174
174
Field Type Null Default Default_is_NULL On_Update
176
176
show indexes from t1;
177
177
Table Unique Key_name Seq_in_index Column_name
180
180
create table t1(f1 varbinary(32), f2 varbinary(64));
181
181
select character_maximum_length, character_octet_length
187
select DATA_TYPE, group_concat(table_schema, '.', table_name), count(*) as num
187
select DATA_TYPE, group_concat(table_schema, '.', table_name) as a, count(*) as num
188
188
from data_dictionary.columns where
189
189
table_schema='data_dictionary' and
190
190
(DATA_TYPE = 'varchar' or DATA_TYPE = 'varchar'
191
191
or DATA_TYPE = 'varchar')
192
192
group by DATA_TYPE order by DATA_TYPE, num;
193
DATA_TYPE group_concat(table_schema, '.', table_name) num
194
VARCHAR DATA_DICTIONARY.CHARACTER_SETS,DATA_DICTIONARY.CHARACTER_SETS,DATA_DICTIONARY.CHARACTER_SETS,DATA_DICTIONARY.COLLATIONS,DATA_DICTIONARY.COLLATIONS,DATA_DICTIONARY.COLLATIONS,DATA_DICTIONARY.COLLATIONS,DATA_DICTIONARY.COLLATIONS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.COLUMNS,DATA_DICTIONARY.GLOBAL_STATEMENTS,DATA_DICTIONARY.GLOBAL_STATEMENTS,DATA_DICTIONARY.GLOBAL_STATUS,DATA_DICTIONARY.GLOBAL_STATUS,DATA_DICTIONARY.GLOBAL_VARIABLES,DATA_DICTIONARY.GLOBAL_VARIABLES,DATA_DICTIONARY.INDEXES,DATA_DICTIONARY.INDEXES,DATA_DICTIONARY.INDEXES,DATA_DICTIONARY.INDEXES,DATA_DICTIONARY.INDEXES,DATA_DICTIONARY.INDEXES,DATA_DICTIONARY.INDEXES,DATA_DICTIONARY.INDEXES,DATA_DICTIONARY.INDEX_PART 145
196
Warning 1260 1 line(s) were cut by GROUP_CONCAT()
196
Warning # 1 line(s) were cut by GROUP_CONCAT()
197
197
create table t1(f1 char(1) not null, f2 char(9) not null);
198
198
select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from
199
199
data_dictionary.columns where table_schema='test' and table_name = 't1';
302
302
select column_name,column_default,column_default_is_null from data_dictionary.columns where table_name= 't1';
303
303
column_name column_default column_default_is_null
311
f8 2006-01-01 00:00:00 NO
312
312
show columns from t1;
313
313
Field Type Null Default Default_is_NULL On_Update
315
f2 VARCHAR FALSE FALSE
316
f3 VARCHAR TRUE FALSE
318
f5 BIGINT FALSE FALSE
319
f6 BIGINT FALSE 10 FALSE
320
f7 DATETIME FALSE FALSE
321
f8 DATETIME TRUE 2006-01-01 FALSE
321
f8 DATETIME YES 2006-01-01 00:00:00 NO
323
323
SET max_heap_table_size = DEFAULT;
357
357
SELECT * FROM data_dictionary.collations ORDER BY collation_name;
358
358
CHARACTER_SET_NAME COLLATION_NAME DESCRIPTION ID IS_DEFAULT IS_COMPILED SORTLEN
359
binary binary binary 63 TRUE TRUE 1
360
utf8_general_ci utf8_bin utf8 46 FALSE TRUE 1
361
utf8_general_ci utf8_czech_ci utf8 234 FALSE TRUE 8
362
utf8_general_ci utf8_danish_ci utf8 235 FALSE TRUE 8
363
utf8_general_ci utf8_esperanto_ci utf8 241 FALSE TRUE 8
364
utf8_general_ci utf8_estonian_ci utf8 230 FALSE TRUE 8
365
utf8_general_ci utf8_general_ci utf8 45 TRUE TRUE 1
366
utf8_general_ci utf8_hungarian_ci utf8 242 FALSE TRUE 8
367
utf8_general_ci utf8_icelandic_ci utf8 225 FALSE TRUE 8
368
utf8_general_ci utf8_latvian_ci utf8 226 FALSE TRUE 8
369
utf8_general_ci utf8_lithuanian_ci utf8 236 FALSE TRUE 8
370
utf8_general_ci utf8_persian_ci utf8 240 FALSE TRUE 8
371
utf8_general_ci utf8_polish_ci utf8 229 FALSE TRUE 8
372
utf8_general_ci utf8_romanian_ci utf8 227 FALSE TRUE 8
373
utf8_general_ci utf8_roman_ci utf8 239 FALSE TRUE 8
374
utf8_general_ci utf8_sinhala_ci utf8 243 FALSE TRUE 8
375
utf8_general_ci utf8_slovak_ci utf8 237 FALSE TRUE 8
376
utf8_general_ci utf8_slovenian_ci utf8 228 FALSE TRUE 8
377
utf8_general_ci utf8_spanish2_ci utf8 238 FALSE TRUE 8
378
utf8_general_ci utf8_spanish_ci utf8 231 FALSE TRUE 8
379
utf8_general_ci utf8_swedish_ci utf8 232 FALSE TRUE 8
380
utf8_general_ci utf8_turkish_ci utf8 233 FALSE TRUE 8
381
utf8_general_ci utf8_unicode_ci utf8 224 FALSE TRUE 8
359
binary binary binary 63 YES YES 1
360
utf8_general_ci utf8_bin utf8 46 NO YES 1
361
utf8_general_ci utf8_czech_ci utf8 234 NO YES 8
362
utf8_general_ci utf8_danish_ci utf8 235 NO YES 8
363
utf8_general_ci utf8_esperanto_ci utf8 241 NO YES 8
364
utf8_general_ci utf8_estonian_ci utf8 230 NO YES 8
365
utf8_general_ci utf8_general_ci utf8 45 YES YES 1
366
utf8_general_ci utf8_hungarian_ci utf8 242 NO YES 8
367
utf8_general_ci utf8_icelandic_ci utf8 225 NO YES 8
368
utf8_general_ci utf8_latvian_ci utf8 226 NO YES 8
369
utf8_general_ci utf8_lithuanian_ci utf8 236 NO YES 8
370
utf8_general_ci utf8_persian_ci utf8 240 NO YES 8
371
utf8_general_ci utf8_polish_ci utf8 229 NO YES 8
372
utf8_general_ci utf8_romanian_ci utf8 227 NO YES 8
373
utf8_general_ci utf8_roman_ci utf8 239 NO YES 8
374
utf8_general_ci utf8_sinhala_ci utf8 243 NO YES 8
375
utf8_general_ci utf8_slovak_ci utf8 237 NO YES 8
376
utf8_general_ci utf8_slovenian_ci utf8 228 NO YES 8
377
utf8_general_ci utf8_spanish2_ci utf8 238 NO YES 8
378
utf8_general_ci utf8_spanish_ci utf8 231 NO YES 8
379
utf8_general_ci utf8_swedish_ci utf8 232 NO YES 8
380
utf8_general_ci utf8_turkish_ci utf8 233 NO YES 8
381
utf8_general_ci utf8_unicode_ci utf8 224 NO YES 8
382
382
SELECT table_name, column_name
383
383
FROM data_dictionary.columns
384
384
WHERE table_name IN