~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/information_schema.result

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5;
2
2
select * from information_schema.SCHEMATA where schema_name > 'm';
3
3
CATALOG_NAME    SCHEMA_NAME     DEFAULT_CHARACTER_SET_NAME      DEFAULT_COLLATION_NAME  SQL_PATH
4
 
NULL    mysql   utf8    utf8_general_ci NULL
5
 
NULL    test    utf8    utf8_general_ci NULL
 
4
NULL    mysql   latin1  latin1_swedish_ci       NULL
 
5
NULL    test    latin1  latin1_swedish_ci       NULL
6
6
select schema_name from information_schema.schemata;
7
7
schema_name
8
8
information_schema
36
36
t2
37
37
t3
38
38
t5
 
39
show table status;
 
40
Name    Engine  Version Row_format      Rows    Avg_row_length  Data_length     Max_data_length Index_length    Data_free       Auto_increment  Create_time     Update_time     Check_time      Collation       Checksum        Create_options  Comment
 
41
t2      InnoDB  10      Compact 0       0       16384   #       0       0       NULL    #       #       NULL    latin1_swedish_ci       NULL            
 
42
t3      InnoDB  10      Compact 0       0       16384   #       16384   0       NULL    #       #       NULL    latin1_swedish_ci       NULL            
 
43
t5      InnoDB  10      Compact 1       16384   16384   #       0       0       11      #       #       NULL    latin1_swedish_ci       NULL            
39
44
show full columns from t3 like "a%";
40
45
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
41
 
a       int     NULL    YES     MUL     NULL            #       
 
46
a       int     NULL    YES     MUL     NULL                    
42
47
select * from information_schema.COLUMNS where table_name="t1"
43
48
and column_name= "a";
44
49
TABLE_CATALOG   TABLE_SCHEMA    TABLE_NAME      COLUMN_NAME     ORDINAL_POSITION        COLUMN_DEFAULT  IS_NULLABLE     DATA_TYPE       CHARACTER_MAXIMUM_LENGTH        CHARACTER_OCTET_LENGTH  NUMERIC_PRECISION       NUMERIC_SCALE   CHARACTER_SET_NAME      COLLATION_NAME  COLUMN_TYPE     COLUMN_KEY      EXTRA   PRIVILEGES      COLUMN_COMMENT  STORAGE FORMAT
57
62
select * from information_schema.CHARACTER_SETS
58
63
where CHARACTER_SET_NAME like 'latin1%';
59
64
CHARACTER_SET_NAME      DEFAULT_COLLATE_NAME    DESCRIPTION     MAXLEN
 
65
latin1  latin1_swedish_ci       cp1252 West European    1
 
66
SHOW CHARACTER SET LIKE 'latin1%';
 
67
Charset Description     Default collation       Maxlen
 
68
latin1  cp1252 West European    latin1_swedish_ci       1
60
69
select * from information_schema.COLLATIONS
61
70
where COLLATION_NAME like 'latin1%';
62
71
COLLATION_NAME  CHARACTER_SET_NAME      ID      IS_DEFAULT      IS_COMPILED     SORTLEN
 
72
latin1_german1_ci       latin1  5               #       1
 
73
latin1_swedish_ci       latin1  8       Yes     #       1
 
74
latin1_danish_ci        latin1  15              #       1
 
75
latin1_german2_ci       latin1  31              #       2
 
76
latin1_bin      latin1  47              #       1
 
77
latin1_general_ci       latin1  48              #       1
 
78
latin1_general_cs       latin1  49              #       1
 
79
latin1_spanish_ci       latin1  94              #       1
 
80
SHOW COLLATION LIKE 'latin1%';
 
81
Collation       Charset Id      Default Compiled        Sortlen
 
82
latin1_german1_ci       latin1  5               #       1
 
83
latin1_swedish_ci       latin1  8       Yes     #       1
 
84
latin1_danish_ci        latin1  15              #       1
 
85
latin1_german2_ci       latin1  31              #       2
 
86
latin1_bin      latin1  47              #       1
 
87
latin1_general_ci       latin1  48              #       1
 
88
latin1_general_cs       latin1  49              #       1
 
89
latin1_spanish_ci       latin1  94              #       1
63
90
select * from information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
64
91
where COLLATION_NAME like 'latin1%';
65
92
COLLATION_NAME  CHARACTER_SET_NAME
 
93
latin1_german1_ci       latin1
 
94
latin1_swedish_ci       latin1
 
95
latin1_danish_ci        latin1
 
96
latin1_german2_ci       latin1
 
97
latin1_bin      latin1
 
98
latin1_general_ci       latin1
 
99
latin1_general_cs       latin1
 
100
latin1_spanish_ci       latin1
66
101
select * from information_schema.table_names;
67
102
ERROR 42S02: Unknown table 'table_names' in information_schema
68
103
select column_type from information_schema.columns
91
126
TABLES  CREATE_TIME     datetime
92
127
TABLES  UPDATE_TIME     datetime
93
128
TABLES  CHECK_TIME      datetime
94
 
INNODB_TRX      trx_started     datetime
95
 
INNODB_TRX      trx_wait_started        datetime
96
129
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES A
97
130
WHERE NOT EXISTS 
98
131
(SELECT * FROM INFORMATION_SCHEMA.COLUMNS B
103
136
create table t1
104
137
( x_bigint BIGINT,
105
138
x_integer INTEGER,
106
 
x_int int,
 
139
x_smallint SMALLINT,
107
140
x_decimal DECIMAL(5,3),
108
141
x_numeric NUMERIC(5,3),
109
142
x_real REAL,
115
148
COLUMN_NAME     CHARACTER_MAXIMUM_LENGTH        CHARACTER_OCTET_LENGTH
116
149
x_bigint        NULL    NULL
117
150
x_integer       NULL    NULL
118
 
x_int   NULL    NULL
 
151
x_smallint      NULL    NULL
119
152
x_decimal       NULL    NULL
120
153
x_numeric       NULL    NULL
121
154
x_real  NULL    NULL
125
158
SELECT table_schema, count(*) FROM information_schema.TABLES
126
159
WHERE table_name NOT LIKE 'ndb_%' AND table_name NOT LIKE 'falcon%' GROUP BY TABLE_SCHEMA;
127
160
table_schema    count(*)
128
 
information_schema      23
 
161
information_schema      16
129
162
show create database information_schema;
130
163
Database        Create Database
131
164
information_schema      CREATE DATABASE `information_schema` /*!40100 DEFAULT CHARACTER SET utf8 */
138
171
f1      blob    4294967295      4294967295
139
172
f2      text    4294967295      4294967295
140
173
drop table t1;
141
 
create table t1(f1 int, f2 int, f3 BIGINT, f4 int,
142
 
f5 BIGINT, f6 int, f7 int);
 
174
create table t1(f1 tinyint, f2 SMALLINT, f3 BIGINT, f4 int,
 
175
f5 BIGINT, f6 TINYINT, f7 SMALLINT);
143
176
select column_name, NUMERIC_PRECISION, NUMERIC_SCALE
144
177
from information_schema.columns
145
178
where table_name='t1';
146
179
column_name     NUMERIC_PRECISION       NUMERIC_SCALE
147
 
f1      10      0
148
 
f2      10      0
 
180
f1      3       0
 
181
f2      5       0
149
182
f3      19      0
150
183
f4      10      0
151
184
f5      19      0
152
 
f6      10      0
153
 
f7      10      0
 
185
f6      3       0
 
186
f7      5       0
154
187
drop table t1;
155
188
create table t1 (a int not null, b int);
156
189
use information_schema;
215
248
column_type     group_concat(table_schema, '.', table_name)     num
216
249
varchar(20)     information_schema.PLUGINS      1
217
250
varchar(27)     information_schema.COLUMNS      1
218
 
create table t1(f1 char(1) not null, f2 char(9) not null);
 
251
create table t1(f1 char(1) not null, f2 char(9) not null)
 
252
default character set utf8;
219
253
select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from
220
254
information_schema.columns where table_schema='test' and table_name = 't1';
221
255
CHARACTER_MAXIMUM_LENGTH        CHARACTER_OCTET_LENGTH
263
297
STATISTICS      TABLE_SCHEMA
264
298
TABLES  TABLE_SCHEMA
265
299
TABLE_CONSTRAINTS       CONSTRAINT_SCHEMA
266
 
INNODB_CMP_RESET        page_size
267
 
INNODB_TRX      trx_id
268
 
INNODB_CMPMEM_RESET     page_size
269
 
INNODB_LOCK_WAITS       requesting_trx_id
270
 
INNODB_CMPMEM   page_size
271
 
INNODB_CMP      page_size
272
 
INNODB_LOCKS    lock_id
273
300
SELECT t.table_name, c1.column_name
274
301
FROM information_schema.tables t
275
302
INNER JOIN
302
329
STATISTICS      TABLE_SCHEMA
303
330
TABLES  TABLE_SCHEMA
304
331
TABLE_CONSTRAINTS       CONSTRAINT_SCHEMA
305
 
INNODB_CMP_RESET        page_size
306
 
INNODB_TRX      trx_id
307
 
INNODB_CMPMEM_RESET     page_size
308
 
INNODB_LOCK_WAITS       requesting_trx_id
309
 
INNODB_CMPMEM   page_size
310
 
INNODB_CMP      page_size
311
 
INNODB_LOCKS    lock_id
312
332
SELECT MAX(table_name) FROM information_schema.tables;
313
333
MAX(table_name)
314
334
TABLE_CONSTRAINTS
355
375
COLUMNS information_schema.COLUMNS      1
356
376
GLOBAL_STATUS   information_schema.GLOBAL_STATUS        1
357
377
GLOBAL_VARIABLES        information_schema.GLOBAL_VARIABLES     1
358
 
INNODB_CMP      information_schema.INNODB_CMP   1
359
 
INNODB_CMPMEM   information_schema.INNODB_CMPMEM        1
360
 
INNODB_CMPMEM_RESET     information_schema.INNODB_CMPMEM_RESET  1
361
 
INNODB_CMP_RESET        information_schema.INNODB_CMP_RESET     1
362
 
INNODB_LOCKS    information_schema.INNODB_LOCKS 1
363
 
INNODB_LOCK_WAITS       information_schema.INNODB_LOCK_WAITS    1
364
 
INNODB_TRX      information_schema.INNODB_TRX   1
365
378
KEY_COLUMN_USAGE        information_schema.KEY_COLUMN_USAGE     1
366
379
PLUGINS information_schema.PLUGINS      1
367
380
PROCESSLIST     information_schema.PROCESSLIST  1