~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/show_check.result

Merge Revision revid:marko.makela@oracle.com-20100505101406-u4low2x26q6itck0 from MySQL InnoDB

Original revid:marko.makela@oracle.com-20100505101406-u4low2x26q6itck0

Original Authors: Marko Mäkelä <marko.makela@oracle.com>
Original commit message:
Merge from mysql-5.1-innodb:

  ------------------------------------------------------------
  revno: 3446
  revision-id: marko.makela@oracle.com-20100505100507-6kcd2hf32hruxbv7
  parent: marko.makela@oracle.com-20100505095328-vetnl0flhmhao7p5
  committer: Marko Mäkelä <marko.makela@oracle.com>
  branch nick: 5.1-innodb
  timestamp: Wed 2010-05-05 13:05:07 +0300
  message:
    Add Valgrind diagnostics to track down Bug #38999.
  ------------------------------------------------------------

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
-- Here we enable metadata just to check that the collation of the
8
8
-- resultset is non-binary for string type. This should be changed
9
9
-- after Bug#29394 is implemented.
10
 
check table t1 fast;
11
 
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
12
 
def                                     Table   253     128     7       Y       0       31      8
13
 
def                                     Op      253     10      5       Y       0       31      8
14
 
def                                     Msg_type        253     10      6       Y       0       31      8
15
 
def                                     Msg_text        253     255     27      Y       0       31      8
16
 
Table   Op      Msg_type        Msg_text
17
 
test.t1 check   status  Table is already up to date
18
 
check table t1 fast;
19
 
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
20
 
def                                     Table   253     128     7       Y       0       31      8
21
 
def                                     Op      253     10      5       Y       0       31      8
22
 
def                                     Msg_type        253     10      6       Y       0       31      8
23
 
def                                     Msg_text        253     255     27      Y       0       31      8
24
 
Table   Op      Msg_type        Msg_text
25
 
test.t1 check   status  Table is already up to date
26
 
check table t1 changed;
27
 
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
28
 
def                                     Table   253     128     7       Y       0       31      8
29
 
def                                     Op      253     10      5       Y       0       31      8
30
 
def                                     Msg_type        253     10      6       Y       0       31      8
31
 
def                                     Msg_text        253     255     2       Y       0       31      8
 
10
check table t1;
 
11
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
 
12
def                                     Table   8       512     7       Y       0       31      45
 
13
def                                     Op      8       40      5       Y       0       31      45
 
14
def                                     Msg_type        8       40      6       Y       0       31      45
 
15
def                                     Msg_text        8       1020    2       Y       0       31      45
32
16
Table   Op      Msg_type        Msg_text
33
17
test.t1 check   status  OK
34
18
insert into t1 values (5,5,5);
35
 
check table t1 changed;
36
 
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
37
 
def                                     Table   253     128     7       Y       0       31      8
38
 
def                                     Op      253     10      5       Y       0       31      8
39
 
def                                     Msg_type        253     10      6       Y       0       31      8
40
 
def                                     Msg_text        253     255     2       Y       0       31      8
41
 
Table   Op      Msg_type        Msg_text
42
 
test.t1 check   status  OK
43
 
check table t1 medium;
44
 
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
45
 
def                                     Table   253     128     7       Y       0       31      8
46
 
def                                     Op      253     10      5       Y       0       31      8
47
 
def                                     Msg_type        253     10      6       Y       0       31      8
48
 
def                                     Msg_text        253     255     2       Y       0       31      8
49
 
Table   Op      Msg_type        Msg_text
50
 
test.t1 check   status  OK
51
 
check table t1 extended;
52
 
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
53
 
def                                     Table   253     128     7       Y       0       31      8
54
 
def                                     Op      253     10      5       Y       0       31      8
55
 
def                                     Msg_type        253     10      6       Y       0       31      8
56
 
def                                     Msg_text        253     255     2       Y       0       31      8
 
19
check table t1;
 
20
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
 
21
def                                     Table   8       512     7       Y       0       31      45
 
22
def                                     Op      8       40      5       Y       0       31      45
 
23
def                                     Msg_type        8       40      6       Y       0       31      45
 
24
def                                     Msg_text        8       1020    2       Y       0       31      45
57
25
Table   Op      Msg_type        Msg_text
58
26
test.t1 check   status  OK
59
27
show index from t1;
60
28
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
61
 
def                     STATISTICS      TABLE_NAME      Table   253     64      2       N       1       0       8
62
 
def                     STATISTICS      NON_UNIQUE      Non_unique      8       1       1       N       32769   0       63
63
 
def                     STATISTICS      INDEX_NAME      Key_name        253     64      7       N       1       0       8
64
 
def                     STATISTICS      SEQ_IN_INDEX    Seq_in_index    8       2       1       N       32769   0       63
65
 
def                     STATISTICS      COLUMN_NAME     Column_name     253     64      1       N       1       0       8
66
 
def                     STATISTICS      COLLATION       Collation       253     1       1       Y       0       0       8
67
 
def                     STATISTICS      CARDINALITY     Cardinality     8       21      1       Y       32768   0       63
68
 
def                     STATISTICS      SUB_PART        Sub_part        8       3       0       Y       32768   0       63
69
 
def                     STATISTICS      PACKED  Packed  253     10      0       Y       0       0       8
70
 
def                     STATISTICS      NULLABLE        Null    253     3       0       N       1       0       8
71
 
def                     STATISTICS      INDEX_TYPE      Index_type      253     16      5       N       1       0       8
72
 
def                     STATISTICS      COMMENT Comment 253     16      0       Y       0       0       8
73
 
def                     STATISTICS      INDEX_COMMENT   Index_Comment   253     1024    0       N       1       0       8
74
 
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
75
 
t1      0       PRIMARY 1       a       A       5       NULL    NULL            BTREE           
76
 
t1      1       b       1       b       A       1       NULL    NULL            BTREE           
77
 
t1      1       b       2       c       A       5       NULL    NULL            BTREE           
 
29
def     data_dictionary show_indexes    SHOW_INDEXES    Table   Table   8       1024    2       N       4097    0       45
 
30
def     data_dictionary show_indexes    SHOW_INDEXES    Unique  Unique  8       20      3       N       4097    0       45
 
31
def     data_dictionary show_indexes    SHOW_INDEXES    Key_name        Key_name        8       1024    7       N       4097    0       45
 
32
def     data_dictionary show_indexes    SHOW_INDEXES    Seq_in_index    Seq_in_index    5       20      1       N       36865   0       63
 
33
def     data_dictionary show_indexes    SHOW_INDEXES    Column_name     Column_name     8       1024    1       N       4097    0       45
 
34
Table   Unique  Key_name        Seq_in_index    Column_name
 
35
t1      YES     PRIMARY 1       a
 
36
t1      NO      b       1       b
 
37
t1      NO      b       2       c
78
38
insert into t1 values (5,5,5);
79
39
ERROR 23000: Duplicate entry '5' for key 'PRIMARY'
80
40
-- Here we enable metadata just to check that the collation of the
81
41
-- resultset is non-binary for string type. This should be changed
82
42
-- after Bug#29394 is implemented.
83
 
optimize table t1;
84
 
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
85
 
def                                     Table   253     128     7       Y       0       31      8
86
 
def                                     Op      253     10      8       Y       0       31      8
87
 
def                                     Msg_type        253     10      6       Y       0       31      8
88
 
def                                     Msg_text        253     255     2       Y       0       31      8
89
 
Table   Op      Msg_type        Msg_text
90
 
test.t1 optimize        status  OK
91
 
optimize table t1;
92
 
Table   Op      Msg_type        Msg_text
93
 
test.t1 optimize        status  Table is already up to date
 
43
alter table t1 engine="default";
 
44
alter table t1 engine="default";
94
45
drop table t1;
95
46
-- Here we enable metadata just to check that the collation of the
96
47
-- resultset is non-binary for string type. This should be changed
97
48
-- after Bug#29394 is implemented.
98
 
show variables like "wait_timeout%";
99
 
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
100
 
def                     VARIABLES       VARIABLE_NAME   Variable_name   253     64      12      N       1       0       8
101
 
def                     VARIABLES       VARIABLE_VALUE  Value   253     16300   5       Y       0       0       8
102
 
Variable_name   Value
103
 
wait_timeout    28800
104
 
show variables like "WAIT_timeout%";
105
 
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
106
 
def                     VARIABLES       VARIABLE_NAME   Variable_name   253     64      12      N       1       0       8
107
 
def                     VARIABLES       VARIABLE_VALUE  Value   253     16300   5       Y       0       0       8
108
 
Variable_name   Value
109
 
wait_timeout    28800
 
49
show variables like "server_id%";
 
50
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
 
51
def     data_dictionary session_variables       SESSION_VARIABLES       VARIABLE_NAME   Variable_name   8       1024    9       N       4097    0       45
 
52
def     data_dictionary session_variables       SESSION_VARIABLES       VARIABLE_VALUE  Value   8       4096    1       N       4097    0       45
 
53
Variable_name   Value
 
54
server_id       1
 
55
show variables like "SERVER_id%";
 
56
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
 
57
def     data_dictionary session_variables       SESSION_VARIABLES       VARIABLE_NAME   Variable_name   8       1024    9       N       4097    0       45
 
58
def     data_dictionary session_variables       SESSION_VARIABLES       VARIABLE_VALUE  Value   8       4096    1       N       4097    0       45
 
59
Variable_name   Value
 
60
server_id       1
110
61
show variables like "this_doesn't_exists%";
111
62
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
112
 
def                     VARIABLES       VARIABLE_NAME   Variable_name   253     64      0       N       1       0       8
113
 
def                     VARIABLES       VARIABLE_VALUE  Value   253     16300   0       Y       0       0       8
 
63
def     data_dictionary session_variables       SESSION_VARIABLES       VARIABLE_NAME   Variable_name   8       1024    0       N       4097    0       45
 
64
def     data_dictionary session_variables       SESSION_VARIABLES       VARIABLE_VALUE  Value   8       4096    0       N       4097    0       45
114
65
Variable_name   Value
115
66
show table status from test like "this_doesn't_exists%";
116
67
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
117
 
def                     TABLES  TABLE_NAME      Name    253     64      0       N       1       0       8
118
 
def                     TABLES  ENGINE  Engine  253     64      0       Y       0       0       8
119
 
def                     TABLES  VERSION Version 8       21      0       Y       32800   0       63
120
 
def                     TABLES  ROW_FORMAT      Row_format      253     10      0       Y       0       0       8
121
 
def                     TABLES  TABLE_ROWS      Rows    8       21      0       Y       32800   0       63
122
 
def                     TABLES  AVG_ROW_LENGTH  Avg_row_length  8       21      0       Y       32800   0       63
123
 
def                     TABLES  DATA_LENGTH     Data_length     8       21      0       Y       32800   0       63
124
 
def                     TABLES  MAX_DATA_LENGTH Max_data_length 8       21      0       Y       32800   0       63
125
 
def                     TABLES  INDEX_LENGTH    Index_length    8       21      0       Y       32800   0       63
126
 
def                     TABLES  DATA_FREE       Data_free       8       21      0       Y       32800   0       63
127
 
def                     TABLES  AUTO_INCREMENT  Auto_increment  8       21      0       Y       32800   0       63
128
 
def                     TABLES  CREATE_TIME     Create_time     12      19      0       Y       128     0       63
129
 
def                     TABLES  UPDATE_TIME     Update_time     12      19      0       Y       128     0       63
130
 
def                     TABLES  CHECK_TIME      Check_time      12      19      0       Y       128     0       63
131
 
def                     TABLES  TABLE_COLLATION Collation       253     64      0       Y       0       0       8
132
 
def                     TABLES  CHECKSUM        Checksum        8       21      0       Y       32800   0       63
133
 
def                     TABLES  CREATE_OPTIONS  Create_options  253     255     0       Y       0       0       8
134
 
def                     TABLES  TABLE_COMMENT   Comment 253     2048    0       N       1       0       8
135
 
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
 
68
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Session Session 5       20      0       N       36865   0       63
 
69
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Schema  Schema  8       1024    0       N       4097    0       45
 
70
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Name    Name    8       1024    0       N       4097    0       45
 
71
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Type    Type    8       1024    0       N       4097    0       45
 
72
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Engine  Engine  8       1024    0       N       4097    0       45
 
73
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Version Version 8       1024    0       N       4097    0       45
 
74
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Rows    Rows    8       1024    0       N       4097    0       45
 
75
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Avg_row_length  Avg_row_length  8       1024    0       N       4097    0       45
 
76
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Table_size      Table_size      8       1024    0       N       4097    0       45
 
77
def     data_dictionary show_table_status       SHOW_TABLE_STATUS       Auto_increment  Auto_increment  8       1024    0       N       4097    0       45
 
78
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
136
79
show databases;
137
80
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
138
 
def                     SCHEMATA        SCHEMA_NAME     Database        253     64      18      N       1       0       8
 
81
def     data_dictionary show_schemas    SHOW_SCHEMAS    SCHEMA_NAME     Database        8       1024    18      N       4097    0       45
139
82
Database
140
 
information_schema
 
83
DATA_DICTIONARY
 
84
INFORMATION_SCHEMA
141
85
mysql
142
86
test
143
87
show databases like "test%";
144
88
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
145
 
def                     SCHEMATA        SCHEMA_NAME     Database (test%)        253     64      4       N       1       0       8
 
89
def     data_dictionary show_schemas    SHOW_SCHEMAS    SCHEMA_NAME     Database (test%)        8       1024    4       N       4097    0       45
146
90
Database (test%)
147
91
test
148
92
create table t1 (f1 int not null, f2 int not null, f3 int not null, f4 int not null, primary key(f1,f2,f3,f4));
152
96
-- after Bug#29394 is implemented.
153
97
analyze table t1;
154
98
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
155
 
def                                     Table   253     128     7       Y       0       31      8
156
 
def                                     Op      253     10      7       Y       0       31      8
157
 
def                                     Msg_type        253     10      6       Y       0       31      8
158
 
def                                     Msg_text        253     255     2       Y       0       31      8
 
99
def                                     Table   8       512     7       Y       0       31      45
 
100
def                                     Op      8       40      7       Y       0       31      45
 
101
def                                     Msg_type        8       40      6       Y       0       31      45
 
102
def                                     Msg_text        8       1020    2       Y       0       31      45
159
103
Table   Op      Msg_type        Msg_text
160
104
test.t1 analyze status  OK
161
105
show index from t1;
162
 
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
163
 
t1      0       PRIMARY 1       f1      A       1       NULL    NULL            BTREE           
164
 
t1      0       PRIMARY 2       f2      A       3       NULL    NULL            BTREE           
165
 
t1      0       PRIMARY 3       f3      A       9       NULL    NULL            BTREE           
166
 
t1      0       PRIMARY 4       f4      A       18      NULL    NULL            BTREE           
167
 
repair table t1;
168
 
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
169
 
def                                     Table   253     128     7       Y       0       31      8
170
 
def                                     Op      253     10      6       Y       0       31      8
171
 
def                                     Msg_type        253     10      6       Y       0       31      8
172
 
def                                     Msg_text        253     255     2       Y       0       31      8
173
 
Table   Op      Msg_type        Msg_text
174
 
test.t1 repair  status  OK
 
106
Table   Unique  Key_name        Seq_in_index    Column_name
 
107
t1      YES     PRIMARY 1       f1
 
108
t1      YES     PRIMARY 2       f2
 
109
t1      YES     PRIMARY 3       f3
 
110
t1      YES     PRIMARY 4       f4
175
111
show index from t1;
176
 
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
177
 
t1      0       PRIMARY 1       f1      A       1       NULL    NULL            BTREE           
178
 
t1      0       PRIMARY 2       f2      A       3       NULL    NULL            BTREE           
179
 
t1      0       PRIMARY 3       f3      A       9       NULL    NULL            BTREE           
180
 
t1      0       PRIMARY 4       f4      A       18      NULL    NULL            BTREE           
 
112
Table   Unique  Key_name        Seq_in_index    Column_name
 
113
t1      YES     PRIMARY 1       f1
 
114
t1      YES     PRIMARY 2       f2
 
115
t1      YES     PRIMARY 3       f3
 
116
t1      YES     PRIMARY 4       f4
181
117
drop table t1;
182
118
create temporary table t1 (a int not null);
183
119
show create table t1;
184
120
Table   Create Table
185
 
t1      CREATE TEMPORARY TABLE "t1" (
186
 
  "a" int(11) NOT NULL
187
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
121
t1      CREATE TEMPORARY TABLE `t1` (
 
122
  `a` INT NOT NULL
 
123
) ENGINE=DEFAULT COLLATE = utf8_general_ci
188
124
alter table t1 rename t2;
189
125
show create table t2;
190
126
Table   Create Table
191
 
t2      CREATE TEMPORARY TABLE "t2" (
192
 
  "a" int(11) NOT NULL
193
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
127
t2      CREATE TEMPORARY TABLE `t2` (
 
128
  `a` INT NOT NULL
 
129
) ENGINE=DEFAULT COLLATE = utf8_general_ci
194
130
drop table t2;
195
131
create table t1 (
196
 
test_set set( 'val1', 'val2', 'val3' ) not null default '',
197
132
name char(20) default 'O''Brien' comment 'O''Brien as default',
198
133
c int not null comment 'int column',
199
134
`c-b` int comment 'name with a minus',
204
136
  ) comment = 'it\'s a table' ;
205
137
show create table t1;
206
138
Table   Create Table
207
 
t1      CREATE TABLE "t1" (
208
 
  "test_set" set('val1','val2','val3') NOT NULL,
209
 
  "name" char(20) COMMENT 'O''Brien as default',
210
 
  "c" int(11) NOT NULL COMMENT 'int column',
211
 
  "c-b" int(11) COMMENT 'name with a minus',
212
 
  "space 2" int(11) COMMENT 'name with a space'
213
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
214
 
set sql_quote_show_create=0;
215
 
show create table t1;
216
 
Table   Create Table
217
 
t1      CREATE TABLE t1 (
218
 
  test_set set('val1','val2','val3') NOT NULL,
219
 
  "name" char(20) COMMENT 'O''Brien as default',
220
 
  c int(11) NOT NULL COMMENT 'int column',
221
 
  "c-b" int(11) COMMENT 'name with a minus',
222
 
  "space 2" int(11) COMMENT 'name with a space'
223
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
224
 
set sql_quote_show_create=1;
225
 
show full columns from t1;
226
 
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
227
 
test_set        set('val1','val2','val3')       latin1_swedish_ci       NO              NULL                    
228
 
name    char(20)        latin1_swedish_ci       YES             NULL                    O'Brien as default
229
 
c       int(11) NULL    NO              NULL                    int column
230
 
c-b     int(11) NULL    YES             NULL                    name with a minus
231
 
space 2 int(11) NULL    YES             NULL                    name with a space
 
139
t1      CREATE TABLE `t1` (
 
140
  `name` VARCHAR(20) COLLATE utf8_general_ci DEFAULT 'O''Brien' COMMENT 'O''Brien as default',
 
141
  `c` INT NOT NULL COMMENT 'int column',
 
142
  `c-b` INT DEFAULT NULL COMMENT 'name with a minus',
 
143
  `space 2` INT DEFAULT NULL COMMENT 'name with a space'
 
144
) ENGINE=DEFAULT COMMENT='it''s a table' COLLATE = utf8_general_ci
 
145
show columns from t1;
 
146
Field   Type    Null    Default Default_is_NULL On_Update
 
147
name    VARCHAR YES     O'Brien NO      
 
148
c       INTEGER NO              NO      
 
149
c-b     INTEGER YES             YES     
 
150
space 2 INTEGER YES             YES     
232
151
drop table t1;
233
152
create table t1 (a int not null, unique aa (a));
234
153
show create table t1;
235
154
Table   Create Table
236
 
t1      CREATE TABLE "t1" (
237
 
  "a" int(11) NOT NULL,
238
 
  UNIQUE KEY "aa" ("a")
239
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
155
t1      CREATE TABLE `t1` (
 
156
  `a` INT NOT NULL,
 
157
  UNIQUE KEY `aa` (`a`)
 
158
) ENGINE=DEFAULT COLLATE = utf8_general_ci
240
159
drop table t1;
241
160
create table t1 (a int not null, primary key (a));
242
161
show create table t1;
243
162
Table   Create Table
244
 
t1      CREATE TABLE "t1" (
245
 
  "a" int(11) NOT NULL,
246
 
  PRIMARY KEY ("a")
247
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
248
 
drop table t1;
249
 
flush tables;
250
 
show open tables;
251
 
Database        Table   In_use  Name_locked
252
 
mysql   general_log     0       0
253
 
create table t1(n int);
254
 
insert into t1 values (1);
255
 
show open tables;
256
 
Database        Table   In_use  Name_locked
257
 
test    t1      0       0
258
 
mysql   general_log     0       0
259
 
drop table t1;
260
 
create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed;
261
 
show create table t1;
262
 
Table   Create Table
263
 
t1      CREATE TABLE "t1" (
264
 
  "a" int(11) NOT NULL,
265
 
  "b" varchar(10),
266
 
  KEY "b" ("b")
267
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
268
 
alter table t1 MAX_ROWS=200 ROW_FORMAT=dynamic PACK_KEYS=0;
269
 
show create table t1;
270
 
Table   Create Table
271
 
t1      CREATE TABLE "t1" (
272
 
  "a" int(11) NOT NULL,
273
 
  "b" varchar(10),
274
 
  KEY "b" ("b")
275
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=200 AVG_ROW_LENGTH=10 PACK_KEYS=0 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='test'
276
 
ALTER TABLE t1 AVG_ROW_LENGTH=0 CHECKSUM=0 COMMENT="" MIN_ROWS=0 MAX_ROWS=0 PACK_KEYS=DEFAULT DELAY_KEY_WRITE=0 ROW_FORMAT=default;
277
 
show create table t1;
278
 
Table   Create Table
279
 
t1      CREATE TABLE "t1" (
280
 
  "a" int(11) NOT NULL,
281
 
  "b" varchar(10),
282
 
  KEY "b" ("b")
283
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
163
t1      CREATE TABLE `t1` (
 
164
  `a` INT NOT NULL,
 
165
  PRIMARY KEY (`a`)
 
166
) ENGINE=DEFAULT COLLATE = utf8_general_ci
 
167
drop table t1;
 
168
create temporary table t1 (a int not null, b VARCHAR(10), INDEX (b) ) COMMENT="test" ENGINE=MYISAM ROW_FORMAT=fixed;
 
169
show create table t1;
 
170
Table   Create Table
 
171
t1      CREATE TEMPORARY TABLE `t1` (
 
172
  `a` INT NOT NULL,
 
173
  `b` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
 
174
  KEY `b` (`b`)
 
175
) ENGINE=MyISAM ROW_FORMAT='fixed' COMMENT='test' COLLATE = utf8_general_ci
 
176
alter table t1 ROW_FORMAT=dynamic;
 
177
show create table t1;
 
178
Table   Create Table
 
179
t1      CREATE TEMPORARY TABLE `t1` (
 
180
  `a` INT NOT NULL,
 
181
  `b` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
 
182
  KEY `b` (`b`)
 
183
) ENGINE=MyISAM ROW_FORMAT='dynamic' COMMENT='test' COLLATE = utf8_general_ci
 
184
ALTER TABLE t1 COMMENT="", ROW_FORMAT='default';
 
185
show create table t1;
 
186
Table   Create Table
 
187
t1      CREATE TEMPORARY TABLE `t1` (
 
188
  `a` INT NOT NULL,
 
189
  `b` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
 
190
  KEY `b` (`b`)
 
191
) ENGINE=MyISAM ROW_FORMAT='default' COLLATE = utf8_general_ci
284
192
drop table t1;
285
193
create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0), h float(3,2), i float(3,0));
286
194
show columns from t1;
287
 
Field   Type    Null    Key     Default Extra
288
 
a       decimal(9,2)    YES             NULL    
289
 
b       decimal(9,0)    YES             NULL    
290
 
e       double(9,2)     YES             NULL    
291
 
f       double(5,0)     YES             NULL    
292
 
h       float(3,2)      YES             NULL    
293
 
i       float(3,0)      YES             NULL    
294
 
show full columns from t1;
295
 
Field   Type    Collation       Null    Key     Default Extra   Privileges      Comment
296
 
a       decimal(9,2)    NULL    YES             NULL                    
297
 
b       decimal(9,0)    NULL    YES             NULL                    
298
 
e       double(9,2)     NULL    YES             NULL                    
299
 
f       double(5,0)     NULL    YES             NULL                    
300
 
h       float(3,2)      NULL    YES             NULL                    
301
 
i       float(3,0)      NULL    YES             NULL                    
 
195
Field   Type    Null    Default Default_is_NULL On_Update
 
196
a       DECIMAL YES             YES     
 
197
b       DECIMAL YES             YES     
 
198
e       DOUBLE  YES             YES     
 
199
f       DOUBLE  YES             YES     
 
200
h       DOUBLE  YES             YES     
 
201
i       DOUBLE  YES             YES     
 
202
show columns from t1;
 
203
Field   Type    Null    Default Default_is_NULL On_Update
 
204
a       DECIMAL YES             YES     
 
205
b       DECIMAL YES             YES     
 
206
e       DOUBLE  YES             YES     
 
207
f       DOUBLE  YES             YES     
 
208
h       DOUBLE  YES             YES     
 
209
i       DOUBLE  YES             YES     
302
210
drop table t1;
303
 
create table t1 (
304
 
type_bool bool not null default 0,
305
 
type_tiny tinyint not null auto_increment primary key,
306
 
type_short smallint(3),
307
 
type_mediumint mediumint,
 
211
create temporary table t1 (
 
212
type_int int,
308
213
type_bigint bigint,
309
214
type_decimal decimal(5,2),
310
215
type_numeric numeric(5,2),
312
217
type_char char(2),
313
218
type_varchar varchar(10),
314
219
type_timestamp timestamp not null,
315
 
type_date date not null default '0000-00-00',
316
 
type_time time not null default '00:00:00',
317
 
type_datetime datetime not null default '0000-00-00 00:00:00',
318
 
type_year year,
 
220
type_date date,
 
221
type_datetime datetime,
319
222
type_enum enum ('red', 'green', 'blue'),
320
223
type_set enum ('red', 'green', 'blue'),
321
 
type_tinyblob tinyblob,
322
224
type_blob blob,
323
 
type_medium_blob mediumblob,
324
 
type_long_blob longblob,
325
 
index(type_short)
326
 
) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1;
 
225
index(type_int)
 
226
) COMMENT="test" ENGINE=MYISAM ROW_FORMAT=fixed;
327
227
show create table t1;
328
228
Table   Create Table
329
 
t1      CREATE TABLE "t1" (
330
 
  "type_bool" tinyint(1) NOT NULL,
331
 
  "type_tiny" tinyint(4) NOT NULL AUTO_INCREMENT,
332
 
  "type_short" smallint(3),
333
 
  "type_mediumint" mediumint(9),
334
 
  "type_bigint" bigint(20),
335
 
  "type_decimal" decimal(5,2),
336
 
  "type_numeric" decimal(5,2),
337
 
  "empty_char" char(0),
338
 
  "type_char" char(2),
339
 
  "type_varchar" varchar(10),
340
 
  "type_timestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
341
 
  "type_date" date NOT NULL,
342
 
  "type_time" time NOT NULL,
343
 
  "type_datetime" datetime NOT NULL,
344
 
  "type_year" year(4),
345
 
  "type_enum" enum('red','green','blue'),
346
 
  "type_set" enum('red','green','blue'),
347
 
  "type_tinyblob" tinyblob,
348
 
  "type_blob" blob,
349
 
  "type_medium_blob" mediumblob,
350
 
  "type_long_blob" longblob,
351
 
  PRIMARY KEY ("type_tiny"),
352
 
  KEY "type_short" ("type_short")
353
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
 
229
t1      CREATE TEMPORARY TABLE `t1` (
 
230
  `type_int` INT DEFAULT NULL,
 
231
  `type_bigint` BIGINT DEFAULT NULL,
 
232
  `type_decimal` DECIMAL(5,2) DEFAULT NULL,
 
233
  `type_numeric` DECIMAL(5,2) DEFAULT NULL,
 
234
  `empty_char` VARCHAR(0) COLLATE utf8_general_ci DEFAULT NULL,
 
235
  `type_char` VARCHAR(2) COLLATE utf8_general_ci DEFAULT NULL,
 
236
  `type_varchar` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL,
 
237
  `type_timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
 
238
  `type_date` DATE DEFAULT NULL,
 
239
  `type_datetime` DATETIME DEFAULT NULL,
 
240
  `type_enum` ENUM('red','green','blue') DEFAULT NULL,
 
241
  `type_set` ENUM('red','green','blue') DEFAULT NULL,
 
242
  `type_blob` BLOB,
 
243
  KEY `type_int` (`type_int`)
 
244
) ENGINE=MyISAM ROW_FORMAT='fixed' COMMENT='test' COLLATE = utf8_general_ci
354
245
insert into t1 (type_timestamp) values ("2003-02-07 10:00:01");
355
246
select * from t1;
356
 
type_bool       type_tiny       type_short      type_mediumint  type_bigint     type_decimal    type_numeric    empty_char      type_char       type_varchar    type_timestamp  type_date       type_time       type_datetime   type_year       type_enum       type_set        type_tinyblob   type_blob       type_medium_blob        type_long_blob
357
 
0       1       NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    2003-02-07 10:00:01     0000-00-00      00:00:00        0000-00-00 00:00:00     NULL    NULL    NULL    NULL    NULL    NULL    NULL
 
247
type_int        type_bigint     type_decimal    type_numeric    empty_char      type_char       type_varchar    type_timestamp  type_date       type_datetime   type_enum       type_set        type_blob
 
248
NULL    NULL    NULL    NULL    NULL    NULL    NULL    2003-02-07 10:00:01     NULL    NULL    NULL    NULL    NULL
358
249
drop table t1;
359
250
create table t1 (a int not null);
360
251
create table t2 select max(a) from t1;
361
252
show columns from t2;
362
 
Field   Type    Null    Key     Default Extra
363
 
max(a)  int(11) YES             NULL    
 
253
Field   Type    Null    Default Default_is_NULL On_Update
 
254
max(a)  INTEGER YES             YES     
364
255
drop table t1,t2;
365
256
create table t1 (c decimal, d double, f float, r real);
366
257
show columns from t1;
367
 
Field   Type    Null    Key     Default Extra
368
 
c       decimal(10,0)   YES             NULL    
369
 
d       double  YES             NULL    
370
 
f       float   YES             NULL    
371
 
r       double  YES             NULL    
 
258
Field   Type    Null    Default Default_is_NULL On_Update
 
259
c       DECIMAL YES             YES     
 
260
d       DOUBLE  YES             YES     
 
261
f       DOUBLE  YES             YES     
 
262
r       DOUBLE  YES             YES     
372
263
drop table t1;
373
264
create table t1 (c decimal(3,3), d double(3,3), f float(3,3));
374
265
show columns from t1;
375
 
Field   Type    Null    Key     Default Extra
376
 
c       decimal(3,3)    YES             NULL    
377
 
d       double(3,3)     YES             NULL    
378
 
f       float(3,3)      YES             NULL    
 
266
Field   Type    Null    Default Default_is_NULL On_Update
 
267
c       DECIMAL YES             YES     
 
268
d       DOUBLE  YES             YES     
 
269
f       DOUBLE  YES             YES     
379
270
drop table t1;
380
271
CREATE TABLE ```ab``cd``` (i INT);
381
272
SHOW CREATE TABLE ```ab``cd```;
382
273
Table   Create Table
383
 
`ab`cd` CREATE TABLE "`ab`cd`" (
384
 
  "i" int(11)
385
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
274
`ab`cd` CREATE TABLE ```ab``cd``` (
 
275
  `i` INT DEFAULT NULL
 
276
) ENGINE=DEFAULT COLLATE = utf8_general_ci
386
277
DROP TABLE ```ab``cd```;
387
278
CREATE TABLE ```ab````cd``` (i INT);
388
279
SHOW CREATE TABLE ```ab````cd```;
389
280
Table   Create Table
390
 
`ab``cd`        CREATE TABLE "`ab``cd`" (
391
 
  "i" int(11)
392
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
281
`ab``cd`        CREATE TABLE ```ab````cd``` (
 
282
  `i` INT DEFAULT NULL
 
283
) ENGINE=DEFAULT COLLATE = utf8_general_ci
393
284
DROP TABLE ```ab````cd```;
394
285
CREATE TABLE ```a` (i INT);
395
286
SHOW CREATE TABLE ```a`;
396
287
Table   Create Table
397
 
`a      CREATE TABLE "`a" (
398
 
  "i" int(11)
399
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
288
`a      CREATE TABLE ```a` (
 
289
  `i` INT DEFAULT NULL
 
290
) ENGINE=DEFAULT COLLATE = utf8_general_ci
400
291
DROP TABLE ```a`;
401
292
CREATE TABLE `a.1` (i INT);
402
293
SHOW CREATE TABLE `a.1`;
403
294
Table   Create Table
404
 
a.1     CREATE TABLE "a.1" (
405
 
  "i" int(11)
406
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
295
a.1     CREATE TABLE `a.1` (
 
296
  `i` INT DEFAULT NULL
 
297
) ENGINE=DEFAULT COLLATE = utf8_general_ci
407
298
DROP TABLE `a.1`;
408
299
select @@max_heap_table_size;
409
300
@@max_heap_table_size
410
301
1048576
411
 
CREATE TABLE t1 (
412
 
a int(11) default NULL,
 
302
CREATE TEMPORARY TABLE t1 (
 
303
a int default NULL,
413
304
KEY a USING BTREE (a)
414
 
) ENGINE=HEAP;
415
 
CREATE TABLE t2 (
416
 
b int(11) default NULL,
 
305
) ENGINE=MEMORY;
 
306
CREATE TEMPORARY TABLE t2 (
 
307
b int default NULL,
417
308
index(b)
418
 
) ENGINE=HEAP;
419
 
CREATE TABLE t3 (
420
 
a int(11) default NULL,
421
 
b int(11) default NULL,
 
309
) ENGINE=MEMORY;
 
310
CREATE TEMPORARY TABLE t3 (
 
311
a int default NULL,
 
312
b int default NULL,
422
313
KEY a USING BTREE (a),
423
314
index(b)
424
 
) ENGINE=HEAP;
 
315
) ENGINE=MEMORY;
425
316
insert into t1 values (1),(2);
426
317
insert into t2 values (1),(2);
427
318
insert into t3 values (1,1),(2,2);
428
319
show table status;
429
 
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
430
 
t1      MEMORY  10      Fixed   2       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
431
 
t2      MEMORY  10      Fixed   2       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
432
 
t3      MEMORY  10      Fixed   2       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
 
320
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
 
321
#       test    t1      TEMPORARY       MEMORY  #       #       #       #       #
 
322
#       test    t2      TEMPORARY       MEMORY  #       #       #       #       #
 
323
#       test    t3      TEMPORARY       MEMORY  #       #       #       #       #
433
324
insert into t1 values (3),(4);
434
325
insert into t2 values (3),(4);
435
326
insert into t3 values (3,3),(4,4);
436
327
show table status;
437
 
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
438
 
t1      MEMORY  10      Fixed   4       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
439
 
t2      MEMORY  10      Fixed   4       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
440
 
t3      MEMORY  10      Fixed   4       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
 
328
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
 
329
#       test    t1      TEMPORARY       MEMORY  #       #       #       #       #
 
330
#       test    t2      TEMPORARY       MEMORY  #       #       #       #       #
 
331
#       test    t3      TEMPORARY       MEMORY  #       #       #       #       #
441
332
insert into t1 values (5);
442
333
insert into t2 values (5);
443
334
insert into t3 values (5,5);
444
335
show table status;
445
 
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
446
 
t1      MEMORY  10      Fixed   5       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
447
 
t2      MEMORY  10      Fixed   5       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
448
 
t3      MEMORY  10      Fixed   5       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
 
336
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
 
337
#       test    t1      TEMPORARY       MEMORY  #       #       #       #       #
 
338
#       test    t2      TEMPORARY       MEMORY  #       #       #       #       #
 
339
#       test    t3      TEMPORARY       MEMORY  #       #       #       #       #
449
340
delete from t1 where a=3;
450
341
delete from t2 where b=3;
451
342
delete from t3 where a=3;
452
343
show table status;
453
 
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
454
 
t1      MEMORY  10      Fixed   4       #       #       #       #       #       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
455
 
t2      MEMORY  10      Fixed   4       #       #       #       #       #       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
456
 
t3      MEMORY  10      Fixed   4       #       #       #       #       #       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
 
344
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
 
345
#       test    t1      TEMPORARY       MEMORY  #       #       #       #       #
 
346
#       test    t2      TEMPORARY       MEMORY  #       #       #       #       #
 
347
#       test    t3      TEMPORARY       MEMORY  #       #       #       #       #
457
348
truncate table t1;
458
349
truncate table t2;
459
350
truncate table t3;
460
351
show table status;
461
 
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
462
 
t1      MEMORY  10      Fixed   0       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
463
 
t2      MEMORY  10      Fixed   0       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
464
 
t3      MEMORY  10      Fixed   0       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
 
352
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
 
353
#       test    t1      TEMPORARY       MEMORY  #       #       #       #       #
 
354
#       test    t2      TEMPORARY       MEMORY  #       #       #       #       #
 
355
#       test    t3      TEMPORARY       MEMORY  #       #       #       #       #
465
356
insert into t1 values (5);
466
357
insert into t2 values (5);
467
358
insert into t3 values (5,5);
468
359
show table status;
469
 
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
470
 
t1      MEMORY  10      Fixed   1       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
471
 
t2      MEMORY  10      Fixed   1       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
472
 
t3      MEMORY  10      Fixed   1       #       #       #       #       0       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
 
360
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
 
361
#       test    t1      TEMPORARY       MEMORY  #       #       #       #       #
 
362
#       test    t2      TEMPORARY       MEMORY  #       #       #       #       #
 
363
#       test    t3      TEMPORARY       MEMORY  #       #       #       #       #
473
364
delete from t1 where a=5;
474
365
delete from t2 where b=5;
475
366
delete from t3 where a=5;
476
367
show table status;
477
 
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
478
 
t1      MEMORY  10      Fixed   0       #       #       #       #       #       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
479
 
t2      MEMORY  10      Fixed   0       #       #       #       #       #       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
480
 
t3      MEMORY  10      Fixed   0       #       #       #       #       #       NULL    NULL    NULL    NULL    latin1_swedish_ci       NULL            
 
368
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
 
369
#       test    t1      TEMPORARY       MEMORY  #       #       #       #       #
 
370
#       test    t2      TEMPORARY       MEMORY  #       #       #       #       #
 
371
#       test    t3      TEMPORARY       MEMORY  #       #       #       #       #
481
372
drop table t1, t2, t3;
482
 
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
483
 
SHOW CREATE TABLE t1;
484
 
Table   Create Table
485
 
t1      CREATE TABLE "t1" (
486
 
  "i" int(11),
487
 
  KEY "i" ("i")
488
 
) ENGINE=MEMORY DEFAULT CHARSET=latin1
489
 
DROP TABLE t1;
490
 
CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
491
 
SHOW CREATE TABLE t1;
492
 
Table   Create Table
493
 
t1      CREATE TABLE "t1" (
494
 
  "i" int(11),
495
 
  KEY "i" ("i") USING HASH
496
 
) ENGINE=MEMORY DEFAULT CHARSET=latin1
497
 
DROP TABLE t1;
498
 
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
499
 
SHOW CREATE TABLE t1;
500
 
Table   Create Table
501
 
t1      CREATE TABLE "t1" (
502
 
  "i" int(11),
503
 
  KEY "i" ("i") USING BTREE
504
 
) ENGINE=MEMORY DEFAULT CHARSET=latin1
505
 
DROP TABLE t1;
506
 
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
507
 
SHOW CREATE TABLE t1;
508
 
Table   Create Table
509
 
t1      CREATE TABLE "t1" (
510
 
  "i" int(11),
511
 
  KEY "i" ("i")
512
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
513
 
DROP TABLE t1;
514
 
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
515
 
SHOW CREATE TABLE t1;
516
 
Table   Create Table
517
 
t1      CREATE TABLE "t1" (
518
 
  "i" int(11),
519
 
  KEY "i" ("i") USING BTREE
520
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
521
 
DROP TABLE t1;
522
 
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
523
 
SHOW CREATE TABLE t1;
524
 
Table   Create Table
525
 
t1      CREATE TABLE "t1" (
526
 
  "i" int(11),
527
 
  KEY "i" ("i")
528
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
529
 
ALTER TABLE t1 ENGINE=MEMORY;
530
 
SHOW CREATE TABLE t1;
531
 
Table   Create Table
532
 
t1      CREATE TABLE "t1" (
533
 
  "i" int(11),
534
 
  KEY "i" ("i")
535
 
) ENGINE=MEMORY DEFAULT CHARSET=latin1
536
 
DROP TABLE t1;
537
 
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
538
 
SHOW CREATE TABLE t1;
539
 
Table   Create Table
540
 
t1      CREATE TABLE "t1" (
541
 
  "i" int(11),
542
 
  KEY "i" ("i") USING BTREE
543
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
544
 
ALTER TABLE t1 ENGINE=MEMORY;
545
 
SHOW CREATE TABLE t1;
546
 
Table   Create Table
547
 
t1      CREATE TABLE "t1" (
548
 
  "i" int(11),
549
 
  KEY "i" ("i") USING BTREE
550
 
) ENGINE=MEMORY DEFAULT CHARSET=latin1
 
373
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
 
374
SHOW CREATE TABLE t1;
 
375
Table   Create Table
 
376
t1      CREATE TEMPORARY TABLE `t1` (
 
377
  `i` INT DEFAULT NULL,
 
378
  KEY `i` (`i`)
 
379
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
380
DROP TABLE t1;
 
381
CREATE TEMPORARY TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
 
382
SHOW CREATE TABLE t1;
 
383
Table   Create Table
 
384
t1      CREATE TEMPORARY TABLE `t1` (
 
385
  `i` INT DEFAULT NULL,
 
386
  KEY `i` (`i`) USING HASH
 
387
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
388
DROP TABLE t1;
 
389
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
 
390
SHOW CREATE TABLE t1;
 
391
Table   Create Table
 
392
t1      CREATE TEMPORARY TABLE `t1` (
 
393
  `i` INT DEFAULT NULL,
 
394
  KEY `i` (`i`) USING BTREE
 
395
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
396
DROP TABLE t1;
 
397
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
 
398
SHOW CREATE TABLE t1;
 
399
Table   Create Table
 
400
t1      CREATE TEMPORARY TABLE `t1` (
 
401
  `i` INT DEFAULT NULL,
 
402
  KEY `i` (`i`)
 
403
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
404
DROP TABLE t1;
 
405
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
 
406
SHOW CREATE TABLE t1;
 
407
Table   Create Table
 
408
t1      CREATE TEMPORARY TABLE `t1` (
 
409
  `i` INT DEFAULT NULL,
 
410
  KEY `i` (`i`) USING BTREE
 
411
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
412
DROP TABLE t1;
 
413
CREATE TEMPORARY TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
 
414
SHOW CREATE TABLE t1;
 
415
Table   Create Table
 
416
t1      CREATE TEMPORARY TABLE `t1` (
 
417
  `i` INT DEFAULT NULL,
 
418
  KEY `i` (`i`)
 
419
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
420
ALTER TABLE t1 ENGINE=MEMORY;
 
421
SHOW CREATE TABLE t1;
 
422
Table   Create Table
 
423
t1      CREATE TEMPORARY TABLE `t1` (
 
424
  `i` INT DEFAULT NULL,
 
425
  KEY `i` (`i`)
 
426
) ENGINE=MEMORY COLLATE = utf8_general_ci
 
427
DROP TABLE t1;
 
428
CREATE TEMPORARY TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
 
429
SHOW CREATE TABLE t1;
 
430
Table   Create Table
 
431
t1      CREATE TEMPORARY TABLE `t1` (
 
432
  `i` INT DEFAULT NULL,
 
433
  KEY `i` (`i`) USING BTREE
 
434
) ENGINE=MyISAM COLLATE = utf8_general_ci
 
435
ALTER TABLE t1 ENGINE=MEMORY;
 
436
SHOW CREATE TABLE t1;
 
437
Table   Create Table
 
438
t1      CREATE TEMPORARY TABLE `t1` (
 
439
  `i` INT DEFAULT NULL,
 
440
  KEY `i` (`i`) USING BTREE
 
441
) ENGINE=MEMORY COLLATE = utf8_general_ci
551
442
DROP TABLE t1;
552
443
CREATE TABLE t1(
553
444
field1 text NOT NULL,
554
 
PRIMARY KEY(field1(1000))
 
445
PRIMARY KEY(field1(180))
555
446
);
556
447
show index from t1;
557
448
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
558
 
def                     STATISTICS      TABLE_NAME      Table   253     64      2       N       1       0       8
559
 
def                     STATISTICS      NON_UNIQUE      Non_unique      8       1       1       N       32769   0       63
560
 
def                     STATISTICS      INDEX_NAME      Key_name        253     64      7       N       1       0       8
561
 
def                     STATISTICS      SEQ_IN_INDEX    Seq_in_index    8       2       1       N       32769   0       63
562
 
def                     STATISTICS      COLUMN_NAME     Column_name     253     64      6       N       1       0       8
563
 
def                     STATISTICS      COLLATION       Collation       253     1       1       Y       0       0       8
564
 
def                     STATISTICS      CARDINALITY     Cardinality     8       21      1       Y       32768   0       63
565
 
def                     STATISTICS      SUB_PART        Sub_part        8       3       4       Y       32768   0       63
566
 
def                     STATISTICS      PACKED  Packed  253     10      0       Y       0       0       8
567
 
def                     STATISTICS      NULLABLE        Null    253     3       0       N       1       0       8
568
 
def                     STATISTICS      INDEX_TYPE      Index_type      253     16      5       N       1       0       8
569
 
def                     STATISTICS      COMMENT Comment 253     16      0       Y       0       0       8
570
 
def                     STATISTICS      INDEX_COMMENT   Index_Comment   253     1024    0       N       1       0       8
571
 
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
572
 
t1      0       PRIMARY 1       field1  A       0       1000    NULL            BTREE           
 
449
def     data_dictionary show_indexes    SHOW_INDEXES    Table   Table   8       1024    2       N       4097    0       45
 
450
def     data_dictionary show_indexes    SHOW_INDEXES    Unique  Unique  8       20      3       N       4097    0       45
 
451
def     data_dictionary show_indexes    SHOW_INDEXES    Key_name        Key_name        8       1024    7       N       4097    0       45
 
452
def     data_dictionary show_indexes    SHOW_INDEXES    Seq_in_index    Seq_in_index    5       20      1       N       36865   0       63
 
453
def     data_dictionary show_indexes    SHOW_INDEXES    Column_name     Column_name     8       1024    6       N       4097    0       45
 
454
Table   Unique  Key_name        Seq_in_index    Column_name
 
455
t1      YES     PRIMARY 1       field1
573
456
drop table t1;
574
457
create table t1 (
575
458
c1 int NOT NULL,
579
462
);
580
463
SHOW CREATE TABLE t1;
581
464
Table   Create Table
582
 
t1      CREATE TABLE "t1" (
583
 
  "c1" int(11) NOT NULL,
584
 
  "c2" int(11) NOT NULL,
585
 
  PRIMARY KEY ("c1") USING HASH,
586
 
  KEY "c2" ("c2") USING BTREE
587
 
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
465
t1      CREATE TABLE `t1` (
 
466
  `c1` INT NOT NULL,
 
467
  `c2` INT NOT NULL,
 
468
  PRIMARY KEY (`c1`) USING HASH,
 
469
  KEY `c2` (`c2`) USING BTREE
 
470
) ENGINE=DEFAULT COLLATE = utf8_general_ci
588
471
DROP TABLE t1;
589
 
flush tables;
590
 
SHOW TABLE STATUS like 't1';
591
 
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
592
 
t1      NULL    NULL    NULL    NULL    #       #       #       #       NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Incorrect information in file: './test/t1.frm'
593
 
show create table t1;
594
 
ERROR HY000: Incorrect information in file: './test/t1.frm'
595
 
drop table if exists t1;
596
 
 
597
 
# Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
598
 
 
599
 
DROP DATABASE IF EXISTS mysqltest1;
600
 
CREATE DATABASE mysqltest1;
601
 
use mysqltest1;
602
 
 
603
 
CREATE TABLE t1(a INT);
604
 
CREATE TABLE t2(a INT);
605
 
 
606
 
FLUSH TABLES;
607
 
 
608
 
SELECT 1 FROM t1;
609
 
1
610
 
SELECT 1 FROM t2;
611
 
1
612
 
 
613
 
SHOW OPEN TABLES FROM mysqltest1;
614
 
Database        Table   In_use  Name_locked
615
 
mysqltest1      t1      0       0
616
 
mysqltest1      t2      0       0
617
 
 
618
 
SHOW OPEN TABLES FROM mysqltest1 LIKE 'z%';
619
 
Database        Table   In_use  Name_locked
620
 
 
621
 
SHOW OPEN TABLES FROM mysqltest1 LIKE 't1%';
622
 
Database        Table   In_use  Name_locked
623
 
mysqltest1      t1      0       0
624
 
 
625
 
SHOW OPEN TABLES FROM mysqltest1 LIKE '%1%';
626
 
Database        Table   In_use  Name_locked
627
 
mysqltest1      t1      0       0
628
 
 
629
 
FLUSH TABLES;
630
 
 
631
 
DROP DATABASE mysqltest1;
632
 
use test;
633
 
 
634
472
SHOW TABLES FROM non_existing_database;
635
 
ERROR 42000: Unknown database 'non_existing_database'
 
473
ERROR 42000: Unknown schema 'non_existing_database'
636
474
End of 4.1 tests
637
475
SHOW TABLES FROM no_such_database;
638
 
ERROR 42000: Unknown database 'no_such_database'
 
476
ERROR 42000: Unknown schema 'no_such_database'
639
477
SHOW COLUMNS FROM no_such_table;
640
478
ERROR 42S02: Table 'test.no_such_table' doesn't exist
641
 
flush status;
642
 
show variables like "log_queries_not_using_indexes";
643
 
Variable_name   Value
644
 
log_queries_not_using_indexes   ON
645
 
select 1 from information_schema.tables limit 1;
646
 
1
647
 
1
648
 
show status like 'slow_queries';
649
 
Variable_name   Value
650
 
Slow_queries    1
651
 
set global log_queries_not_using_indexes=OFF;
652
 
show variables like "log_queries_not_using_indexes";
653
 
Variable_name   Value
654
 
log_queries_not_using_indexes   OFF
655
 
select 1 from information_schema.tables limit 1;
656
 
1
657
 
1
658
 
show status like 'slow_queries';
659
 
Variable_name   Value
660
 
Slow_queries    1
661
 
set global log_queries_not_using_indexes=ON;
662
 
show variables like "log_queries_not_using_indexes";
663
 
Variable_name   Value
664
 
log_queries_not_using_indexes   ON
665
 
select 1 from information_schema.tables limit 1;
666
 
1
667
 
1
668
 
show status like 'slow_queries';
669
 
Variable_name   Value
670
 
Slow_queries    2
671
479
show variables like 'myisam_recover_options';
672
480
Variable_name   Value
673
 
myisam_recover_options  OFF
674
481
End of 5.0 tests
675
 
SHOW AUTHORS;
676
 
show plugins;
677
482
create database `mysqlttest\1`;
678
483
create table `mysqlttest\1`.`a\b` (a int);
679
484
show tables from `mysqlttest\1`;
680
485
Tables_in_mysqlttest\1
681
486
a\b
682
487
show fields from `mysqlttest\1`.`a\b`;
683
 
Field   Type    Null    Key     Default Extra
684
 
a       int(11) YES             NULL    
 
488
Field   Type    Null    Default Default_is_NULL On_Update
 
489
a       INTEGER YES             YES     
685
490
show columns from `a\b` from `mysqlttest\1`;
686
 
Field   Type    Null    Key     Default Extra
687
 
a       int(11) YES             NULL    
 
491
Field   Type    Null    Default Default_is_NULL On_Update
 
492
a       INTEGER YES             YES     
688
493
show keys from `mysqlttest\1`.`a\b`;
689
 
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
 
494
Table   Unique  Key_name        Seq_in_index    Column_name
690
495
drop table `mysqlttest\1`.`a\b`;
691
496
drop database `mysqlttest\1`;
692
 
show engine foobar status;
693
 
ERROR 42000: Unknown table engine 'foobar'
694
 
show engine foobar logs;
695
 
ERROR 42000: Unknown table engine 'foobar'
696
 
show engine foobar mutex;
697
 
ERROR 42000: Unknown table engine 'foobar'
698
 
show engine mutex status;
699
 
ERROR 42000: Unknown table engine 'mutex'
700
 
show engine csv status;
701
 
Type    Name    Status
702
 
show engine csv logs;
703
 
Type    Name    Status
704
 
show engine csv mutex;
705
 
Type    Name    Status
706
 
set names utf8;
707
497
drop table if exists `été`;
708
498
create table `été` (field1 int);
709
 
show full tables;
710
 
Tables_in_test  Table_type
711
 
été     BASE TABLE
 
499
show tables;
 
500
Tables_in_test
 
501
été
712
502
drop table `été`;
713
 
set names latin1;
714
503
show columns from `#mysql50#????????`;
715
504
Got one of the listed errors
716
505
End of 5.1 tests