Bug#7219 information_schema: errors in "columns"

changed field names in 'collations' table(discussed with PGulutzan)
parent 8fb20802
......@@ -172,7 +172,7 @@ CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
latin1 latin1_swedish_ci ISO 8859-1 West European 1
select * from information_schema.COLLATIONS
where COLLATION_NAME like 'latin1%';
COLLATION_NAME CHARSET ID DEFAULT COMPILED SORTLEN
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
latin1_german1_ci latin1 5 0
latin1_swedish_ci latin1 8 Yes Yes 1
latin1_danish_ci latin1 15 0
......@@ -192,7 +192,7 @@ latin1_general_ci latin1 48 0
latin1_general_cs latin1 49 0
latin1_spanish_ci latin1 94 0
SHOW COLLATION * LIKE 'latin1%';
COLLATION_NAME CHARSET ID DEFAULT COMPILED SORTLEN
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
latin1_german1_ci latin1 5 0
latin1_swedish_ci latin1 8 Yes Yes 1
latin1_danish_ci latin1 15 0
......@@ -222,7 +222,7 @@ latin1_general_ci
latin1_general_cs
latin1_spanish_ci
SHOW COLLATION * WHERE COLLATION_NAME like 'latin1%';
COLLATION_NAME CHARSET ID DEFAULT COMPILED SORTLEN
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
latin1_german1_ci latin1 5 0
latin1_swedish_ci latin1 8 Yes Yes 1
latin1_danish_ci latin1 15 0
......@@ -467,20 +467,20 @@ drop table t1;
SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets;
Table Create Table
character_sets CREATE TEMPORARY TABLE `character_sets` (
`CHARACTER_SET_NAME` varchar(30) NOT NULL default '',
`DEFAULT_COLLATE_NAME` varchar(60) NOT NULL default '',
`CHARACTER_SET_NAME` varchar(64) NOT NULL default '',
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '',
`DESCRIPTION` varchar(60) NOT NULL default '',
`MAXLEN` bigint(3) NOT NULL default '0'
) ENGINE=HEAP DEFAULT CHARSET=utf8 MAX_ROWS=2267
) ENGINE=HEAP DEFAULT CHARSET=utf8 MAX_ROWS=1818
set names latin2;
SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets;
Table Create Table
character_sets CREATE TEMPORARY TABLE `character_sets` (
`CHARACTER_SET_NAME` varchar(30) NOT NULL default '',
`DEFAULT_COLLATE_NAME` varchar(60) NOT NULL default '',
`CHARACTER_SET_NAME` varchar(64) NOT NULL default '',
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '',
`DESCRIPTION` varchar(60) NOT NULL default '',
`MAXLEN` bigint(3) NOT NULL default '0'
) ENGINE=HEAP DEFAULT CHARSET=utf8 MAX_ROWS=2267
) ENGINE=HEAP DEFAULT CHARSET=utf8 MAX_ROWS=1818
set names latin1;
create table t1 select * from information_schema.CHARACTER_SETS
where CHARACTER_SET_NAME like "latin1";
......@@ -491,8 +491,8 @@ alter table t1 default character set utf8;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`CHARACTER_SET_NAME` varchar(30) NOT NULL default '',
`DEFAULT_COLLATE_NAME` varchar(60) NOT NULL default '',
`CHARACTER_SET_NAME` varchar(64) NOT NULL default '',
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '',
`DESCRIPTION` varchar(60) NOT NULL default '',
`MAXLEN` bigint(3) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8
......@@ -641,3 +641,9 @@ drop view t3;
drop table t4;
select * from information_schema.table_names;
ERROR 42S02: Unknown table 'table_names' in information_schema
select column_type from information_schema.columns
where table_schema="information_schema" and table_name="COLUMNS" and
(column_name="character_set_name" or column_name="collation_name");
column_type
varchar(64)
varchar(64)
......@@ -331,3 +331,11 @@ drop table t4;
#
--error 1109
select * from information_schema.table_names;
#
# Bug#2719 information_schema: errors in "columns"
#
select column_type from information_schema.columns
where table_schema="information_schema" and table_name="COLUMNS" and
(column_name="character_set_name" or column_name="collation_name");
......@@ -3453,7 +3453,7 @@ ST_FIELD_INFO schema_fields_info[]=
{
{"CATALOG_NAME", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
{"SCHEMA_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Database"},
{"DEFAULT_CHARACTER_SET_NAME", 60, MYSQL_TYPE_STRING, 0, 0, 0},
{"DEFAULT_CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0},
{"SQL_PATH", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
};
......@@ -3500,8 +3500,8 @@ ST_FIELD_INFO columns_fields_info[]=
{"CHARACTER_OCTET_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 0, 0},
{"NUMERIC_PRECISION", 21 , MYSQL_TYPE_LONG, 0, 1, 0},
{"NUMERIC_SCALE", 21 , MYSQL_TYPE_LONG, 0, 1, 0},
{"CHARACTER_SET_NAME", 40, MYSQL_TYPE_STRING, 0, 1, 0},
{"COLLATION_NAME", 40, MYSQL_TYPE_STRING, 0, 1, "Collation"},
{"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 1, 0},
{"COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 1, "Collation"},
{"COLUMN_TYPE", 65535, MYSQL_TYPE_STRING, 0, 0, "Type"},
{"COLUMN_KEY", 3, MYSQL_TYPE_STRING, 0, 0, "Key"},
{"EXTRA", 20, MYSQL_TYPE_STRING, 0, 0, "Extra"},
......@@ -3513,8 +3513,8 @@ ST_FIELD_INFO columns_fields_info[]=
ST_FIELD_INFO charsets_fields_info[]=
{
{"CHARACTER_SET_NAME", 30, MYSQL_TYPE_STRING, 0, 0, "Charset"},
{"DEFAULT_COLLATE_NAME", 60, MYSQL_TYPE_STRING, 0, 0, "Default collation"},
{"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Charset"},
{"DEFAULT_COLLATE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Default collation"},
{"DESCRIPTION", 60, MYSQL_TYPE_STRING, 0, 0, "Description"},
{"MAXLEN", 3 ,MYSQL_TYPE_LONG, 0, 0, "Maxlen"},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
......@@ -3523,11 +3523,11 @@ ST_FIELD_INFO charsets_fields_info[]=
ST_FIELD_INFO collation_fields_info[]=
{
{"COLLATION_NAME", 30, MYSQL_TYPE_STRING, 0, 0, "Collation"},
{"CHARSET", 30, MYSQL_TYPE_STRING, 0, 0, "Charset"},
{"COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Collation"},
{"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Charset"},
{"ID", 11, MYSQL_TYPE_LONG, 0, 0, "Id"},
{"DEFAULT", 30 ,MYSQL_TYPE_STRING, 0, 0, "Default"},
{"COMPILED", 30 ,MYSQL_TYPE_STRING, 0, 0, "Compiled"},
{"IS_DEFAULT", 3, MYSQL_TYPE_STRING, 0, 0, "Default"},
{"IS_COMPILED", 3, MYSQL_TYPE_STRING, 0, 0, "Compiled"},
{"SORTLEN", 3 ,MYSQL_TYPE_LONG, 0, 0, "Sortlen"},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
};
......@@ -3535,8 +3535,8 @@ ST_FIELD_INFO collation_fields_info[]=
ST_FIELD_INFO coll_charset_app_fields_info[]=
{
{"COLLATION_NAME", 30, MYSQL_TYPE_STRING, 0, 0, 0},
{"CHARACTER_SET_NAME", 30, MYSQL_TYPE_STRING, 0, 0, 0},
{"COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0},
{"CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment