diff options
-rw-r--r-- | mysql-test/r/alter_table.result | 6 | ||||
-rw-r--r-- | mysql-test/r/create.result | 38 | ||||
-rw-r--r-- | mysql-test/r/ctype_collate.result | 12 | ||||
-rw-r--r-- | mysql-test/r/ctype_recoding.result | 12 | ||||
-rw-r--r-- | mysql-test/r/gis.result | 86 | ||||
-rw-r--r-- | mysql-test/r/have_ucs2.require | 4 | ||||
-rw-r--r-- | mysql-test/r/have_ujis.require | 4 | ||||
-rw-r--r-- | mysql-test/r/innodb.result | 4 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 32 | ||||
-rw-r--r-- | mysql-test/r/type_blob.result | 20 | ||||
-rw-r--r-- | sql/sql_show.cc | 14 |
11 files changed, 117 insertions, 115 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 7bd836acefd..6c5e06a289f 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -156,9 +156,9 @@ create table t1 (i int unsigned not null auto_increment primary key); alter table t1 rename t2; alter table t2 rename t1, add c char(10) comment "no comment"; show columns from t1; -Field Type Collation Null Key Default Extra -i int(10) unsigned NULL PRI NULL auto_increment -c char(10) latin1_swedish_ci YES NULL +Field Type Null Key Default Extra +i int(10) unsigned PRI NULL auto_increment +c char(10) YES NULL drop table t1; create table t1 (a int, b int); insert into t1 values(1,100), (2,100), (3, 100); diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index bd8343428c2..45b37dfb719 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -82,37 +82,37 @@ drop table t1,t2; create table t1(x varchar(50) ); create table t2 select x from t1 where 1=2; describe t1; -Field Type Collation Null Key Default Extra -x varchar(50) latin1_swedish_ci YES NULL +Field Type Null Key Default Extra +x varchar(50) YES NULL describe t2; -Field Type Collation Null Key Default Extra -x char(50) latin1_swedish_ci YES NULL +Field Type Null Key Default Extra +x char(50) YES NULL drop table t2; create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f; describe t2; -Field Type Collation Null Key Default Extra -a datetime NULL 0000-00-00 00:00:00 -b time NULL 00:00:00 -c date NULL 0000-00-00 -d bigint(17) NULL 0 -e double(18,1) NULL 0.0 -f bigint(17) NULL 0 +Field Type Null Key Default Extra +a datetime 0000-00-00 00:00:00 +b time 00:00:00 +c date 0000-00-00 +d bigint(17) 0 +e double(18,1) 0.0 +f bigint(17) 0 drop table t2; create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt; describe t2; -Field Type Collation Null Key Default Extra -d date NULL 0000-00-00 -t time NULL 00:00:00 -dt datetime NULL 0000-00-00 00:00:00 +Field Type Null Key Default Extra +d date 0000-00-00 +t time 00:00:00 +dt datetime 0000-00-00 00:00:00 drop table t1,t2; create table t1 (a tinyint); create table t2 (a int) select * from t1; describe t1; -Field Type Collation Null Key Default Extra -a tinyint(4) NULL YES NULL +Field Type Null Key Default Extra +a tinyint(4) YES NULL describe t2; -Field Type Collation Null Key Default Extra -a int(11) NULL YES NULL +Field Type Null Key Default Extra +a int(11) YES NULL drop table if exists t2; create table t2 (a int, a float) select * from t1; Duplicate column name 'a' diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result index d2ae3950eaf..00a642d9ee6 100644 --- a/mysql-test/r/ctype_collate.result +++ b/mysql-test/r/ctype_collate.result @@ -489,8 +489,8 @@ t1 CREATE TABLE `t1` ( `latin1_f` char(32) NOT NULL default '' ) TYPE=MyISAM CHARSET=latin1 SHOW FIELDS FROM t1; -Field Type Collation Null Key Default Extra -latin1_f char(32) latin1_swedish_ci +Field Type Null Key Default Extra +latin1_f char(32) ALTER TABLE t1 CHANGE latin1_f latin1_f CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin; SHOW CREATE TABLE t1; @@ -499,8 +499,8 @@ t1 CREATE TABLE `t1` ( `latin1_f` char(32) character set latin1 collate latin1_bin default NULL ) TYPE=MyISAM CHARSET=latin1 SHOW FIELDS FROM t1; -Field Type Collation Null Key Default Extra -latin1_f char(32) latin1_bin YES NULL +Field Type Null Key Default Extra +latin1_f char(32) YES NULL ALTER TABLE t1 CHARACTER SET latin1 COLLATE latin1_bin; SHOW CREATE TABLE t1; Table Create Table @@ -508,8 +508,8 @@ t1 CREATE TABLE `t1` ( `latin1_f` char(32) collate latin1_bin default NULL ) TYPE=MyISAM CHARSET=latin1 COLLATE=latin1_bin SHOW FIELDS FROM t1; -Field Type Collation Null Key Default Extra -latin1_f char(32) latin1_bin YES NULL +Field Type Null Key Default Extra +latin1_f char(32) YES NULL SET CHARACTER SET 'latin1'; SHOW VARIABLES LIKE 'character_set_client'; Variable_name Value diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index fb9e8224111..23a90be1306 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -13,8 +13,8 @@ Table Create Table `ÐÏÌÅ` char(32) character set koi8r NOT NULL default '' ) TYPE=MyISAM CHARSET=latin1 SHOW FIELDS FROM ÔÁÂÌÉÃÁ; -Field Type Collation Null Key Default Extra -ÐÏÌÅ char(32) koi8r_general_ci +Field Type Null Key Default Extra +ÐÏÌÅ char(32) SET CHARACTER SET cp1251; SHOW TABLES; Tables_in_test @@ -25,8 +25,8 @@ Table Create Table `ïîëå` char(32) character set koi8r NOT NULL default '' ) TYPE=MyISAM CHARSET=latin1 SHOW FIELDS FROM òàáëèöà; -Field Type Collation Null Key Default Extra -ïîëå char(32) koi8r_general_ci +Field Type Null Key Default Extra +ïîëå char(32) SET CHARACTER SET utf8; SHOW TABLES; Tables_in_test @@ -37,8 +37,8 @@ Table Create Table `поле` char(32) character set koi8r NOT NULL default '' ) TYPE=MyISAM CHARSET=latin1 SHOW FIELDS FROM таблица; -Field Type Collation Null Key Default Extra -поле char(32) koi8r_general_ci +Field Type Null Key Default Extra +поле char(32) SET CHARACTER SET koi8r; DROP TABLE ÔÁÂÌÉÃÁ; SET CHARACTER SET default; diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 746cdecdfdb..4317daea0b3 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -8,37 +8,37 @@ CREATE TABLE mp (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON); CREATE TABLE gc (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION); CREATE TABLE geo (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY); SHOW FIELDS FROM pt; -Field Type Collation Null Key Default Extra -fid int(11) NULL PRI 0 -g point NULL YES NULL +Field Type Null Key Default Extra +fid int(11) PRI 0 +g point YES NULL SHOW FIELDS FROM ls; -Field Type Collation Null Key Default Extra -fid int(11) NULL PRI 0 -g linestring NULL YES NULL +Field Type Null Key Default Extra +fid int(11) PRI 0 +g linestring YES NULL SHOW FIELDS FROM p; -Field Type Collation Null Key Default Extra -fid int(11) NULL PRI 0 -g polygon NULL YES NULL +Field Type Null Key Default Extra +fid int(11) PRI 0 +g polygon YES NULL SHOW FIELDS FROM mpt; -Field Type Collation Null Key Default Extra -fid int(11) NULL PRI 0 -g multipoint NULL YES NULL +Field Type Null Key Default Extra +fid int(11) PRI 0 +g multipoint YES NULL SHOW FIELDS FROM mls; -Field Type Collation Null Key Default Extra -fid int(11) NULL PRI 0 -g multilinestring NULL YES NULL +Field Type Null Key Default Extra +fid int(11) PRI 0 +g multilinestring YES NULL SHOW FIELDS FROM mp; -Field Type Collation Null Key Default Extra -fid int(11) NULL PRI 0 -g multipolygon NULL YES NULL +Field Type Null Key Default Extra +fid int(11) PRI 0 +g multipolygon YES NULL SHOW FIELDS FROM gc; -Field Type Collation Null Key Default Extra -fid int(11) NULL PRI 0 -g geometrycollection NULL YES NULL +Field Type Null Key Default Extra +fid int(11) PRI 0 +g geometrycollection YES NULL SHOW FIELDS FROM geo; -Field Type Collation Null Key Default Extra -fid int(11) NULL PRI 0 -g geometry NULL YES NULL +Field Type Null Key Default Extra +fid int(11) PRI 0 +g geometry YES NULL INSERT INTO pt VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), @@ -366,27 +366,27 @@ gc geometrycollection, gm geometry ); SHOW FIELDS FROM g1; -Field Type Collation Null Key Default Extra -pt point NULL YES NULL -ln linestring NULL YES NULL -pg polygon NULL YES NULL -mpt multipoint NULL YES NULL -mln multilinestring NULL YES NULL -mpg multipolygon NULL YES NULL -gc geometrycollection NULL YES NULL -gm geometry NULL YES NULL +Field Type Null Key Default Extra +pt point YES NULL +ln linestring YES NULL +pg polygon YES NULL +mpt multipoint YES NULL +mln multilinestring YES NULL +mpg multipolygon YES NULL +gc geometrycollection YES NULL +gm geometry YES NULL ALTER TABLE g1 ADD fid INT NOT NULL; SHOW FIELDS FROM g1; -Field Type Collation Null Key Default Extra -pt point NULL YES NULL -ln linestring NULL YES NULL -pg polygon NULL YES NULL -mpt multipoint NULL YES NULL -mln multilinestring NULL YES NULL -mpg multipolygon NULL YES NULL -gc geometrycollection NULL YES NULL -gm geometry NULL YES NULL -fid int(11) NULL 0 +Field Type Null Key Default Extra +pt point YES NULL +ln linestring YES NULL +pg polygon YES NULL +mpt multipoint YES NULL +mln multilinestring YES NULL +mpg multipolygon YES NULL +gc geometrycollection YES NULL +gm geometry YES NULL +fid int(11) 0 DROP TABLE g1; SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)')))); AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)')))) diff --git a/mysql-test/r/have_ucs2.require b/mysql-test/r/have_ucs2.require index 4f2ef7e83e4..c53250aeaef 100644 --- a/mysql-test/r/have_ucs2.require +++ b/mysql-test/r/have_ucs2.require @@ -1,2 +1,2 @@ -Collation Charset Id D C Sortlen -ucs2_general_ci ucs2 35 Y Y 1 +Collation Charset Id Default Compiled Sortlen +ucs2_general_ci ucs2 35 Yes Yes 1 diff --git a/mysql-test/r/have_ujis.require b/mysql-test/r/have_ujis.require index b4b0a4d256c..b4de2234ec7 100644 --- a/mysql-test/r/have_ujis.require +++ b/mysql-test/r/have_ujis.require @@ -1,2 +1,2 @@ -Collation Charset Id D C Sortlen -ujis_japanese_ci ujis 12 Y Y 0 +Collation Charset Id Default Compiled Sortlen +ujis_japanese_ci ujis 12 Yes Yes 0 diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 0f65c8b0fe3..71dceddab29 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -906,8 +906,8 @@ id select_type table type possible_keys key key_len ref rows Extra drop table t1; create table t1 (t int not null default 1, key (t)) type=innodb; desc t1; -Field Type Collation Null Key Default Extra -t int(11) NULL MUL 1 +Field Type Null Key Default Extra +t int(11) MUL 1 drop table t1; CREATE TABLE t1 ( number bigint(20) NOT NULL default '0', diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index c1f2adc1e31..b867eae5e8d 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -155,13 +155,13 @@ t1 CREATE TABLE `t1` ( drop table t1; 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)); show columns from t1; -Field Type Collation Null Key Default Extra -a decimal(9,2) NULL YES NULL -b decimal(9,0) NULL YES NULL -e double(9,2) NULL YES NULL -f double(5,0) NULL YES NULL -h float(3,2) NULL YES NULL -i float(3,0) NULL YES NULL +Field Type Null Key Default Extra +a decimal(9,2) YES NULL +b decimal(9,0) YES NULL +e double(9,2) YES NULL +f double(5,0) YES NULL +h float(3,2) YES NULL +i float(3,0) YES NULL show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment a decimal(9,2) NULL YES NULL select,insert,update,references @@ -229,16 +229,16 @@ type_bool type_tiny type_short type_mediumint type_bigint type_decimal type_nume drop table t1; create table t1 (c decimal, d double, f float, r real); show columns from t1; -Field Type Collation Null Key Default Extra -c decimal(10,0) NULL YES NULL -d double NULL YES NULL -f float NULL YES NULL -r double NULL YES NULL +Field Type Null Key Default Extra +c decimal(10,0) YES NULL +d double YES NULL +f float YES NULL +r double YES NULL drop table t1; create table t1 (c decimal(3,3), d double(3,3), f float(3,3)); show columns from t1; -Field Type Collation Null Key Default Extra -c decimal(4,3) NULL YES NULL -d double(4,3) NULL YES NULL -f float(4,3) NULL YES NULL +Field Type Null Key Default Extra +c decimal(4,3) YES NULL +d double(4,3) YES NULL +f float(4,3) YES NULL drop table t1; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index f97e2bc06b5..ce1cd392819 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -1,22 +1,22 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7; CREATE TABLE t1 (a blob, b text, c blob(250), d text(70000), e text(70000000)); show columns from t1; -Field Type Collation Null Key Default Extra -a blob NULL YES NULL -b text latin1_swedish_ci YES NULL -c blob NULL YES NULL -d mediumtext latin1_swedish_ci YES NULL -e longtext latin1_swedish_ci YES NULL +Field Type Null Key Default Extra +a blob YES NULL +b text YES NULL +c blob YES NULL +d mediumtext YES NULL +e longtext YES NULL CREATE TABLE t2 (a char(257), b varchar(70000) binary, c varchar(70000000)); Warnings: Warning 1244 Converting column 'a' from CHAR to TEXT Warning 1244 Converting column 'b' from CHAR to BLOB Warning 1244 Converting column 'c' from CHAR to TEXT show columns from t2; -Field Type Collation Null Key Default Extra -a text latin1_swedish_ci YES NULL -b mediumblob NULL YES NULL -c longtext latin1_swedish_ci YES NULL +Field Type Null Key Default Extra +a text YES NULL +b mediumblob YES NULL +c longtext YES NULL create table t3 (a long, b long byte); show create TABLE t3; Table Create Table diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 16934e33798..803280c56c6 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -679,7 +679,8 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild, List<Item> field_list; field_list.push_back(new Item_empty_string("Field",NAME_LEN)); field_list.push_back(new Item_empty_string("Type",40)); - field_list.push_back(new Item_empty_string("Collation",40)); + if (verbose) + field_list.push_back(new Item_empty_string("Collation",40)); field_list.push_back(new Item_empty_string("Null",1)); field_list.push_back(new Item_empty_string("Key",3)); field_list.push_back(item=new Item_empty_string("Default",NAME_LEN)); @@ -719,7 +720,8 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild, protocol->store(field->field_name, system_charset_info); field->sql_type(type); protocol->store(type.ptr(), type.length(), system_charset_info); - protocol->store(field->has_charset() ? field->charset()->name : "NULL", + if (verbose) + protocol->store(field->has_charset() ? field->charset()->name : "NULL", system_charset_info); pos=(byte*) ((flags & NOT_NULL_FLAG) && field->type() != FIELD_TYPE_TIMESTAMP ? @@ -1436,8 +1438,8 @@ static bool write_collation(Protocol *protocol, CHARSET_INFO *cs) protocol->store(cs->name, system_charset_info); protocol->store(cs->csname, system_charset_info); protocol->store_short((longlong) cs->number); - protocol->store((cs->state & MY_CS_PRIMARY) ? "Y" : "",system_charset_info); - protocol->store((cs->state & MY_CS_COMPILED)? "Y" : "",system_charset_info); + protocol->store((cs->state & MY_CS_PRIMARY) ? "Yes" : "",system_charset_info); + protocol->store((cs->state & MY_CS_COMPILED)? "Yes" : "",system_charset_info); protocol->store_short((longlong) cs->strxfrm_multiply); return protocol->write(); } @@ -1456,8 +1458,8 @@ int mysqld_show_collations(THD *thd, const char *wild) field_list.push_back(new Item_empty_string("Collation",30)); field_list.push_back(new Item_empty_string("Charset",30)); field_list.push_back(new Item_return_int("Id",11, FIELD_TYPE_SHORT)); - field_list.push_back(new Item_empty_string("D",30)); - field_list.push_back(new Item_empty_string("C",30)); + field_list.push_back(new Item_empty_string("Default",30)); + field_list.push_back(new Item_empty_string("Compiled",30)); field_list.push_back(new Item_return_int("Sortlen",3, FIELD_TYPE_SHORT)); if (protocol->send_fields(&field_list, 1)) |