diff options
-rw-r--r-- | mysql-test/r/information_schema.result | 19 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 354 | ||||
-rw-r--r-- | mysql-test/t/information_schema.test | 10 | ||||
-rw-r--r-- | sql/field.cc | 7 | ||||
-rw-r--r-- | sql/sql_base.cc | 4 | ||||
-rw-r--r-- | sql/sql_handler.cc | 2 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 | ||||
-rw-r--r-- | sql/table.cc | 4 | ||||
-rw-r--r-- | tests/mysql_client_test.c | 14 |
9 files changed, 221 insertions, 195 deletions
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index a963e1ac248..1559204de23 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -394,11 +394,11 @@ show keys from v4; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment select * from information_schema.views where TABLE_NAME like "v%"; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION -NULL test v0 select `schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci -NULL test v1 select `tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`tables`.`TABLE_NAME` = 'v1') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci -NULL test v2 select `columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`columns`.`TABLE_NAME` = 'v2') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci -NULL test v3 select `character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`character_sets`.`CHARACTER_SET_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci -NULL test v4 select `collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`collations`.`COLLATION_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v0 select `information_schema`.`schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v1 select `information_schema`.`tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`information_schema`.`tables`.`TABLE_NAME` = 'v1') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v2 select `information_schema`.`columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`information_schema`.`columns`.`TABLE_NAME` = 'v2') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v3 select `information_schema`.`character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`information_schema`.`character_sets`.`CHARACTER_SET_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci +NULL test v4 select `information_schema`.`collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`information_schema`.`collations`.`COLLATION_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci drop view v0, v1, v2, v3, v4; create table t1 (a int); grant select,update,insert on t1 to mysqltest_1@localhost; @@ -1487,7 +1487,7 @@ AS SELECT * FROM information_schema.tables; SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS where TABLE_NAME = 'v1'; VIEW_DEFINITION -select `tables`.`TABLE_CATALOG` AS `TABLE_CATALOG`,`tables`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`tables`.`TABLE_NAME` AS `TABLE_NAME`,`tables`.`TABLE_TYPE` AS `TABLE_TYPE`,`tables`.`ENGINE` AS `ENGINE`,`tables`.`VERSION` AS `VERSION`,`tables`.`ROW_FORMAT` AS `ROW_FORMAT`,`tables`.`TABLE_ROWS` AS `TABLE_ROWS`,`tables`.`AVG_ROW_LENGTH` AS `AVG_ROW_LENGTH`,`tables`.`DATA_LENGTH` AS `DATA_LENGTH`,`tables`.`MAX_DATA_LENGTH` AS `MAX_DATA_LENGTH`,`tables`.`INDEX_LENGTH` AS `INDEX_LENGTH`,`tables`.`DATA_FREE` AS `DATA_FREE`,`tables`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,`tables`.`CREATE_TIME` AS `CREATE_TIME`,`tables`.`UPDATE_TIME` AS `UPDATE_TIME`,`tables`.`CHECK_TIME` AS `CHECK_TIME`,`tables`.`TABLE_COLLATION` AS `TABLE_COLLATION`,`tables`.`CHECKSUM` AS `CHECKSUM`,`tables`.`CREATE_OPTIONS` AS `CREATE_OPTIONS`,`tables`.`TABLE_COMMENT` AS `TABLE_COMMENT` from `information_schema`.`tables` +select `information_schema`.`tables`.`TABLE_CATALOG` AS `TABLE_CATALOG`,`information_schema`.`tables`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`tables`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`tables`.`TABLE_TYPE` AS `TABLE_TYPE`,`information_schema`.`tables`.`ENGINE` AS `ENGINE`,`information_schema`.`tables`.`VERSION` AS `VERSION`,`information_schema`.`tables`.`ROW_FORMAT` AS `ROW_FORMAT`,`information_schema`.`tables`.`TABLE_ROWS` AS `TABLE_ROWS`,`information_schema`.`tables`.`AVG_ROW_LENGTH` AS `AVG_ROW_LENGTH`,`information_schema`.`tables`.`DATA_LENGTH` AS `DATA_LENGTH`,`information_schema`.`tables`.`MAX_DATA_LENGTH` AS `MAX_DATA_LENGTH`,`information_schema`.`tables`.`INDEX_LENGTH` AS `INDEX_LENGTH`,`information_schema`.`tables`.`DATA_FREE` AS `DATA_FREE`,`information_schema`.`tables`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,`information_schema`.`tables`.`CREATE_TIME` AS `CREATE_TIME`,`information_schema`.`tables`.`UPDATE_TIME` AS `UPDATE_TIME`,`information_schema`.`tables`.`CHECK_TIME` AS `CHECK_TIME`,`information_schema`.`tables`.`TABLE_COLLATION` AS `TABLE_COLLATION`,`information_schema`.`tables`.`CHECKSUM` AS `CHECKSUM`,`information_schema`.`tables`.`CREATE_OPTIONS` AS `CREATE_OPTIONS`,`information_schema`.`tables`.`TABLE_COMMENT` AS `TABLE_COMMENT` from `information_schema`.`tables` DROP VIEW v1; SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME ='information_schema'; @@ -1699,3 +1699,10 @@ EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE EVENT_OBJECT_SCHEMA='test'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE TRIGGERS ALL NULL EVENT_OBJECT_SCHEMA NULL NULL NULL Using where; Open_full_table; Scanned 1 database +SELECT * +FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE +LEFT JOIN INFORMATION_SCHEMA.COLUMNS +USING (TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME) +WHERE COLUMNS.TABLE_SCHEMA = 'test' +AND COLUMNS.TABLE_NAME = 't1'; +TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG 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 diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index cd59182abd4..65d70a01eb3 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -61,18 +61,18 @@ Table Op Msg_type Msg_text test.t1 check status OK show index from t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def STATISTICS TABLE_NAME Table 253 64 2 N 1 0 8 -def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63 -def STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 8 -def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63 -def STATISTICS COLUMN_NAME Column_name 253 64 1 N 1 0 8 -def STATISTICS COLLATION Collation 253 1 1 Y 0 0 8 -def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63 -def STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63 -def STATISTICS PACKED Packed 253 10 0 Y 0 0 8 -def STATISTICS NULLABLE Null 253 3 0 N 1 0 8 -def STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 8 -def STATISTICS COMMENT Comment 253 16 0 Y 0 0 8 +def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 1 0 8 +def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63 +def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 8 +def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63 +def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 1 N 1 0 8 +def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 0 0 8 +def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63 +def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63 +def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 0 0 8 +def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 1 0 8 +def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 8 +def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 0 0 8 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 0 PRIMARY 1 a A 5 NULL NULL BTREE t1 1 b 1 b A 1 NULL NULL BTREE @@ -99,45 +99,45 @@ drop table t1; -- after Bug#29394 is implemented. show variables like "wait_timeout%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 -def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8 +def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 +def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8 Variable_name Value wait_timeout 28800 show variables like "WAIT_timeout%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 -def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8 +def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 +def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8 Variable_name Value wait_timeout 28800 show variables like "this_doesn't_exists%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8 -def VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8 +def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8 +def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8 Variable_name Value show table status from test like "this_doesn't_exists%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def TABLES TABLE_NAME Name 253 64 0 N 1 0 8 -def TABLES ENGINE Engine 253 64 0 Y 0 0 8 -def TABLES VERSION Version 8 21 0 Y 32800 0 63 -def TABLES ROW_FORMAT Row_format 253 10 0 Y 0 0 8 -def TABLES TABLE_ROWS Rows 8 21 0 Y 32800 0 63 -def TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 32800 0 63 -def TABLES DATA_LENGTH Data_length 8 21 0 Y 32800 0 63 -def TABLES MAX_DATA_LENGTH Max_data_length 8 21 0 Y 32800 0 63 -def TABLES INDEX_LENGTH Index_length 8 21 0 Y 32800 0 63 -def TABLES DATA_FREE Data_free 8 21 0 Y 32800 0 63 -def TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63 -def TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63 -def TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63 -def TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63 -def TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8 -def TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63 -def TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8 -def TABLES TABLE_COMMENT Comment 253 80 0 N 1 0 8 +def information_schema TABLES TABLES TABLE_NAME Name 253 64 0 N 1 0 8 +def information_schema TABLES TABLES ENGINE Engine 253 64 0 Y 0 0 8 +def information_schema TABLES TABLES VERSION Version 8 21 0 Y 32800 0 63 +def information_schema TABLES TABLES ROW_FORMAT Row_format 253 10 0 Y 0 0 8 +def information_schema TABLES TABLES TABLE_ROWS Rows 8 21 0 Y 32800 0 63 +def information_schema TABLES TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 32800 0 63 +def information_schema TABLES TABLES DATA_LENGTH Data_length 8 21 0 Y 32800 0 63 +def information_schema TABLES TABLES MAX_DATA_LENGTH Max_data_length 8 21 0 Y 32800 0 63 +def information_schema TABLES TABLES INDEX_LENGTH Index_length 8 21 0 Y 32800 0 63 +def information_schema TABLES TABLES DATA_FREE Data_free 8 21 0 Y 32800 0 63 +def information_schema TABLES TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63 +def information_schema TABLES TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63 +def information_schema TABLES TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63 +def information_schema TABLES TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63 +def information_schema TABLES TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8 +def information_schema TABLES TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63 +def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8 +def information_schema TABLES TABLES TABLE_COMMENT Comment 253 80 0 N 1 0 8 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 show databases; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def SCHEMATA SCHEMA_NAME Database 253 64 18 N 1 0 8 +def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database 253 64 18 N 1 0 8 Database information_schema mtr @@ -145,7 +145,7 @@ mysql test show databases like "test%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def SCHEMATA SCHEMA_NAME Database (test%) 253 64 4 N 1 0 8 +def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (test%) 253 64 4 N 1 0 8 Database (test%) test 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)); @@ -626,18 +626,18 @@ PRIMARY KEY(field1(1000)) ); show index from t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def STATISTICS TABLE_NAME Table 253 64 2 N 1 0 63 -def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63 -def STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 63 -def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63 -def STATISTICS COLUMN_NAME Column_name 253 64 6 N 1 0 63 -def STATISTICS COLLATION Collation 253 1 1 Y 0 0 63 -def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63 -def STATISTICS SUB_PART Sub_part 8 3 4 Y 32768 0 63 -def STATISTICS PACKED Packed 253 10 0 Y 0 0 63 -def STATISTICS NULLABLE Null 253 3 0 N 1 0 63 -def STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 63 -def STATISTICS COMMENT Comment 253 16 0 Y 0 0 63 +def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 1 0 63 +def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63 +def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 63 +def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63 +def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 6 N 1 0 63 +def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 0 0 63 +def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63 +def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 4 Y 32768 0 63 +def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 0 0 63 +def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 1 0 63 +def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 63 +def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 0 0 63 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 0 PRIMARY 1 field1 A 0 1000 NULL BTREE drop table t1; @@ -858,21 +858,21 @@ set names utf8; ---------------------------------------------------------------- SHOW CHARACTER SET LIKE 'utf8'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 4 N 1 0 33 -def CHARACTER_SETS DESCRIPTION Description 253 180 13 N 1 0 33 -def CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 15 N 1 0 33 -def CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 32769 0 63 +def information_schema CHARACTER_SETS CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 4 N 1 0 33 +def information_schema CHARACTER_SETS CHARACTER_SETS DESCRIPTION Description 253 180 13 N 1 0 33 +def information_schema CHARACTER_SETS CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 15 N 1 0 33 +def information_schema CHARACTER_SETS CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 32769 0 63 Charset Description Default collation Maxlen utf8 UTF-8 Unicode utf8_general_ci 3 ---------------------------------------------------------------- SHOW COLLATION LIKE 'latin1_bin'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COLLATIONS COLLATION_NAME Collation 253 96 10 N 1 0 33 -def COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 1 0 33 -def COLLATIONS ID Id 8 11 2 N 32769 0 63 -def COLLATIONS IS_DEFAULT Default 253 9 0 N 1 0 33 -def COLLATIONS IS_COMPILED Compiled 253 9 3 N 1 0 33 -def COLLATIONS SORTLEN Sortlen 8 3 1 N 32769 0 63 +def information_schema COLLATIONS COLLATIONS COLLATION_NAME Collation 253 96 10 N 1 0 33 +def information_schema COLLATIONS COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 1 0 33 +def information_schema COLLATIONS COLLATIONS ID Id 8 11 2 N 32769 0 63 +def information_schema COLLATIONS COLLATIONS IS_DEFAULT Default 253 9 0 N 1 0 33 +def information_schema COLLATIONS COLLATIONS IS_COMPILED Compiled 253 9 3 N 1 0 33 +def information_schema COLLATIONS COLLATIONS SORTLEN Sortlen 8 3 1 N 32769 0 63 Collation Charset Id Default Compiled Sortlen latin1_bin latin1 47 Yes 1 ---------------------------------------------------------------- @@ -885,7 +885,7 @@ mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */ ---------------------------------------------------------------- SHOW DATABASES LIKE 'mysqltest1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def SCHEMATA SCHEMA_NAME Database (mysqltest1) 253 192 10 N 1 0 33 +def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (mysqltest1) 253 192 10 N 1 0 33 Database (mysqltest1) mysqltest1 ---------------------------------------------------------------- @@ -901,18 +901,18 @@ t1 CREATE TABLE `t1` ( ---------------------------------------------------------------- SHOW INDEX FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def STATISTICS TABLE_NAME Table 253 192 2 N 1 0 33 -def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63 -def STATISTICS INDEX_NAME Key_name 253 192 7 N 1 0 33 -def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63 -def STATISTICS COLUMN_NAME Column_name 253 192 1 N 1 0 33 -def STATISTICS COLLATION Collation 253 3 1 Y 0 0 33 -def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63 -def STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63 -def STATISTICS PACKED Packed 253 30 0 Y 0 0 33 -def STATISTICS NULLABLE Null 253 9 0 N 1 0 33 -def STATISTICS INDEX_TYPE Index_type 253 48 5 N 1 0 33 -def STATISTICS COMMENT Comment 253 48 0 Y 0 0 33 +def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 192 2 N 1 0 33 +def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63 +def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 192 7 N 1 0 33 +def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63 +def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 192 1 N 1 0 33 +def information_schema STATISTICS STATISTICS COLLATION Collation 253 3 1 Y 0 0 33 +def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63 +def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63 +def information_schema STATISTICS STATISTICS PACKED Packed 253 30 0 Y 0 0 33 +def information_schema STATISTICS STATISTICS NULLABLE Null 253 9 0 N 1 0 33 +def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 48 5 N 1 0 33 +def information_schema STATISTICS STATISTICS COMMENT Comment 253 48 0 Y 0 0 33 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 0 PRIMARY 1 c A 0 NULL NULL BTREE ---------------------------------------------------------------- @@ -929,15 +929,15 @@ TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def TABLES TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33 -def TABLES TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33 -def TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 -def TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33 -def TABLES ENGINE ENGINE 253 192 6 Y 0 0 33 -def TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33 -def TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33 -def TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33 -def TABLES TABLE_COMMENT TABLE_COMMENT 253 240 0 N 1 0 33 +def information_schema TABLES TABLES TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33 +def information_schema TABLES TABLES TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33 +def information_schema TABLES TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 +def information_schema TABLES TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33 +def information_schema TABLES TABLES ENGINE ENGINE 253 192 6 Y 0 0 33 +def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33 +def information_schema TABLES TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33 +def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33 +def information_schema TABLES TABLES TABLE_COMMENT TABLE_COMMENT 253 240 0 N 1 0 33 TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION CREATE_OPTIONS TABLE_COMMENT NULL test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci ---------------------------------------------------------------- @@ -959,53 +959,53 @@ COLUMN_COMMENT FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 't1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COLUMNS TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33 -def COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33 -def COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 -def COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33 -def COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589815 0 Y 16 0 33 -def COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33 -def COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33 -def COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33 -def COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33 -def COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33 -def COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33 -def COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33 -def COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 1 0 33 -def COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 765 0 N 1 0 33 +def information_schema COLUMNS COLUMNS TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33 +def information_schema COLUMNS COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33 +def information_schema COLUMNS COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 +def information_schema COLUMNS COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33 +def information_schema COLUMNS COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589815 0 Y 16 0 33 +def information_schema COLUMNS COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33 +def information_schema COLUMNS COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33 +def information_schema COLUMNS COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33 +def information_schema COLUMNS COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33 +def information_schema COLUMNS COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33 +def information_schema COLUMNS COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33 +def information_schema COLUMNS COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33 +def information_schema COLUMNS COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 1 0 33 +def information_schema COLUMNS COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 765 0 N 1 0 33 TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT NULL test t1 c NULL NO int NULL NULL int(11) PRI select,insert,update,references ---------------------------------------------------------------- SHOW TABLES LIKE 't1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def TABLE_NAMES TABLE_NAME Tables_in_test (t1) 253 192 2 N 1 0 33 +def information_schema TABLE_NAMES TABLE_NAMES TABLE_NAME Tables_in_test (t1) 253 192 2 N 1 0 33 Tables_in_test (t1) t1 ---------------------------------------------------------------- SHOW COLUMNS FROM t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def COLUMNS COLUMN_NAME Field 253 192 1 N 1 0 33 -def COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33 -def COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33 -def COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33 -def COLUMNS COLUMN_DEFAULT Default 252 589815 0 Y 16 0 33 -def COLUMNS EXTRA Extra 253 81 0 N 1 0 33 +def information_schema COLUMNS COLUMNS COLUMN_NAME Field 253 192 1 N 1 0 33 +def information_schema COLUMNS COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33 +def information_schema COLUMNS COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33 +def information_schema COLUMNS COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33 +def information_schema COLUMNS COLUMNS COLUMN_DEFAULT Default 252 589815 0 Y 16 0 33 +def information_schema COLUMNS COLUMNS EXTRA Extra 253 81 0 N 1 0 33 Field Type Null Key Default Extra c int(11) NO PRI NULL ---------------------------------------------------------------- SHOW TRIGGERS LIKE 't1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def TRIGGERS TRIGGER_NAME Trigger 253 192 5 N 1 0 33 -def TRIGGERS EVENT_MANIPULATION Event 253 18 6 N 1 0 33 -def TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33 -def TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33 -def TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33 -def TRIGGERS CREATED Created 12 19 0 Y 128 0 63 -def TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33 -def TRIGGERS DEFINER Definer 253 231 14 N 1 0 33 -def TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33 -def TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33 -def TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33 +def information_schema TRIGGERS TRIGGERS TRIGGER_NAME Trigger 253 192 5 N 1 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION Event 253 18 6 N 1 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33 +def information_schema TRIGGERS TRIGGERS CREATED Created 12 19 0 Y 128 0 63 +def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33 +def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 231 14 N 1 0 33 +def information_schema TRIGGERS TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33 +def information_schema TRIGGERS TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33 +def information_schema TRIGGERS TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33 Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation t1_bi INSERT t1 SET @a = 1 BEFORE NULL root@localhost binary binary latin1_swedish_ci ---------------------------------------------------------------- @@ -1030,23 +1030,23 @@ DEFINER FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 't1_bi'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def TRIGGERS TRIGGER_CATALOG TRIGGER_CATALOG 253 1536 0 Y 0 0 33 -def TRIGGERS TRIGGER_SCHEMA TRIGGER_SCHEMA 253 192 4 N 1 0 33 -def TRIGGERS TRIGGER_NAME TRIGGER_NAME 253 192 5 N 1 0 33 -def TRIGGERS EVENT_MANIPULATION EVENT_MANIPULATION 253 18 6 N 1 0 33 -def TRIGGERS EVENT_OBJECT_CATALOG EVENT_OBJECT_CATALOG 253 1536 0 Y 0 0 33 -def TRIGGERS EVENT_OBJECT_SCHEMA EVENT_OBJECT_SCHEMA 253 192 4 N 1 0 33 -def TRIGGERS EVENT_OBJECT_TABLE EVENT_OBJECT_TABLE 253 192 2 N 1 0 33 -def TRIGGERS ACTION_CONDITION ACTION_CONDITION 252 589815 0 Y 16 0 33 -def TRIGGERS ACTION_STATEMENT ACTION_STATEMENT 252 589815 10 N 17 0 33 -def TRIGGERS ACTION_ORIENTATION ACTION_ORIENTATION 253 27 3 N 1 0 33 -def TRIGGERS ACTION_TIMING ACTION_TIMING 253 18 6 N 1 0 33 -def TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y 0 0 33 -def TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33 -def TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33 -def TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33 -def TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 -def TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema TRIGGERS TRIGGERS TRIGGER_CATALOG TRIGGER_CATALOG 253 1536 0 Y 0 0 33 +def information_schema TRIGGERS TRIGGERS TRIGGER_SCHEMA TRIGGER_SCHEMA 253 192 4 N 1 0 33 +def information_schema TRIGGERS TRIGGERS TRIGGER_NAME TRIGGER_NAME 253 192 5 N 1 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION EVENT_MANIPULATION 253 18 6 N 1 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_CATALOG EVENT_OBJECT_CATALOG 253 1536 0 Y 0 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_SCHEMA EVENT_OBJECT_SCHEMA 253 192 4 N 1 0 33 +def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE EVENT_OBJECT_TABLE 253 192 2 N 1 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_CONDITION ACTION_CONDITION 252 589815 0 Y 16 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT ACTION_STATEMENT 252 589815 10 N 17 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_ORIENTATION ACTION_ORIENTATION 253 27 3 N 1 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_TIMING ACTION_TIMING 253 18 6 N 1 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y 0 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33 +def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33 +def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 +def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33 TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER NULL test t1_bi INSERT NULL test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost ---------------------------------------------------------------- @@ -1063,16 +1063,16 @@ SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def VIEWS TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33 -def VIEWS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33 -def VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 -def VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33 -def VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33 -def VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33 -def VIEWS DEFINER DEFINER 253 231 14 N 1 0 33 -def VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 -def VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33 -def VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33 +def information_schema VIEWS VIEWS TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33 +def information_schema VIEWS VIEWS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33 +def information_schema VIEWS VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33 +def information_schema VIEWS VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33 +def information_schema VIEWS VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33 +def information_schema VIEWS VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33 +def information_schema VIEWS VIEWS DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema VIEWS VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 +def information_schema VIEWS VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33 +def information_schema VIEWS VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33 TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION NULL test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary ---------------------------------------------------------------- @@ -1110,24 +1110,24 @@ DEFINER FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33 -def ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33 -def ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33 -def ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33 -def ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 9 N 1 0 33 -def ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 0 Y 0 0 33 -def ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33 -def ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33 -def ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33 -def ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33 -def ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33 -def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33 -def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33 -def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 -def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 -def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 -def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33 -def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 9 N 1 0 33 +def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 0 Y 0 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33 +def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33 +def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33 +def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33 +def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33 +def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33 +def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 +def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 +def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33 +def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33 SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER p1 NULL test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost ---------------------------------------------------------------- @@ -1165,24 +1165,24 @@ DEFINER FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'f1'; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33 -def ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33 -def ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33 -def ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33 -def ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 8 N 1 0 33 -def ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 7 Y 0 0 33 -def ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33 -def ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33 -def ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33 -def ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33 -def ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33 -def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33 -def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33 -def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 -def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 -def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 -def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33 -def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33 +def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 8 N 1 0 33 +def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 7 Y 0 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33 +def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33 +def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33 +def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33 +def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33 +def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33 +def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 +def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 +def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 +def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33 +def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33 SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER f1 NULL test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost ---------------------------------------------------------------- diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index fc9e42b90b5..9da7cc1042d 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1441,5 +1441,15 @@ EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE EVENT_OBJECT_SCHEMA='test'; +# +# Bug #43834 Assertion in Natural_join_column::db_name() on an I_S query +# +SELECT * +FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE +LEFT JOIN INFORMATION_SCHEMA.COLUMNS +USING (TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME) +WHERE COLUMNS.TABLE_SCHEMA = 'test' +AND COLUMNS.TABLE_NAME = 't1'; + # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc diff --git a/sql/field.cc b/sql/field.cc index 65965c925d2..3a51636cfa8 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1527,7 +1527,12 @@ void Field::make_field(Send_field *field) if (orig_table && orig_table->s->db.str && *orig_table->s->db.str) { field->db_name= orig_table->s->db.str; - field->org_table_name= orig_table->s->table_name.str; + if (orig_table->pos_in_table_list && + orig_table->pos_in_table_list->schema_table) + field->org_table_name= (orig_table->pos_in_table_list-> + schema_table->table_name); + else + field->org_table_name= orig_table->s->table_name.str; } else field->org_table_name= field->db_name= ""; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 31242ae0f68..26bcd83d235 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -6010,7 +6010,9 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list, table_name && table_name[0] && (my_strcasecmp(table_alias_charset, table_list->alias, table_name) || (db_name && db_name[0] && table_list->db && table_list->db[0] && - strcmp(db_name, table_list->db)))) + (table_list->schema_table ? + my_strcasecmp(system_charset_info, db_name, table_list->db) : + strcmp(db_name, table_list->db))))) DBUG_RETURN(0); *actual_table= NULL; diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 3bbf4b78d07..00717640974 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -460,7 +460,7 @@ retry: hash_tables->db, hash_tables->table_name, hash_tables->alias, table)); } - + table->pos_in_table_list= tables; #if MYSQL_VERSION_ID < 40100 if (*tables->db && strcmp(table->table_cache_key, tables->db)) { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index d6b01e731f7..84a641ec99a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9947,6 +9947,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, share->primary_key= MAX_KEY; // Indicate no primary key share->keys_for_keyread.init(); share->keys_in_use.init(); + if (param->schema_table) + share->db= INFORMATION_SCHEMA_NAME; /* Calculate which type of fields we will store in the temporary table */ diff --git a/sql/table.cc b/sql/table.cc index 96a10e52dd3..b3e0079b001 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3925,7 +3925,7 @@ const char *Natural_join_column::db_name() DBUG_ASSERT(!strcmp(table_ref->db, table_ref->table->s->db.str) || (table_ref->schema_table && - table_ref->table->s->db.str[0] == 0)); + is_schema_db(table_ref->table->s->db.str))); return table_ref->db; } @@ -4143,7 +4143,7 @@ const char *Field_iterator_table_ref::get_db_name() */ DBUG_ASSERT(!strcmp(table_ref->db, table_ref->table->s->db.str) || (table_ref->schema_table && - table_ref->table->s->db.str[0] == 0)); + is_schema_db(table_ref->table->s->db.str))); return table_ref->db; } diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 9394b0df40b..946fbdf3944 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -7750,26 +7750,26 @@ static void test_explain_bug() verify_prepare_field(result, 0, "Field", "COLUMN_NAME", mysql_get_server_version(mysql) <= 50000 ? MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "", 64, 0); + 0, 0, "information_schema", 64, 0); verify_prepare_field(result, 1, "Type", "COLUMN_TYPE", MYSQL_TYPE_BLOB, - 0, 0, "", 0, 0); + 0, 0, "information_schema", 0, 0); verify_prepare_field(result, 2, "Null", "IS_NULLABLE", mysql_get_server_version(mysql) <= 50000 ? MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "", 3, 0); + 0, 0, "information_schema", 3, 0); verify_prepare_field(result, 3, "Key", "COLUMN_KEY", mysql_get_server_version(mysql) <= 50000 ? MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "", 3, 0); + 0, 0, "information_schema", 3, 0); if ( mysql_get_server_version(mysql) >= 50027 ) { /* The patch for bug#23037 changes column type of DEAULT to blob */ verify_prepare_field(result, 4, "Default", "COLUMN_DEFAULT", - MYSQL_TYPE_BLOB, 0, 0, "", 0, 0); + MYSQL_TYPE_BLOB, 0, 0, "information_schema", 0, 0); } else { @@ -7778,14 +7778,14 @@ static void test_explain_bug() MYSQL_TYPE_BLOB : mysql_get_server_version(mysql) <= 50000 ? MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "", + 0, 0, "information_schema", mysql_get_server_version(mysql) >= 50027 ? 0 :64, 0); } verify_prepare_field(result, 5, "Extra", "EXTRA", mysql_get_server_version(mysql) <= 50000 ? MYSQL_TYPE_STRING : MYSQL_TYPE_VAR_STRING, - 0, 0, "", 27, 0); + 0, 0, "information_schema", 27, 0); mysql_free_result(result); mysql_stmt_close(stmt); |