diff options
author | Sachin Setiya <sachin.setiya@mariadb.com> | 2017-09-12 12:48:08 +0530 |
---|---|---|
committer | Sachin Setiya <sachin.setiya@mariadb.com> | 2017-09-12 12:48:08 +0530 |
commit | 30269f44780b1494be2f6e37ff172b5f7f7d13e0 (patch) | |
tree | d9910639825503349037ae821aef1617a83dd64e | |
parent | a157fc188afc0ad4200bd0ead80c0b5f88a903f5 (diff) | |
download | mariadb-git-bb-sachin-hidden.tar.gz |
gfdgfdgbb-sachin-hidden
-rw-r--r-- | mysql-test/r/hidden_binlog.result | 8 | ||||
-rw-r--r-- | mysql-test/r/hidden_field.result | 96 | ||||
-rw-r--r-- | sql/sql_show.cc | 2 |
3 files changed, 54 insertions, 52 deletions
diff --git a/mysql-test/r/hidden_binlog.result b/mysql-test/r/hidden_binlog.result index dc3b673e05c..96d8475841d 100644 --- a/mysql-test/r/hidden_binlog.result +++ b/mysql-test/r/hidden_binlog.result @@ -11,7 +11,7 @@ a b desc t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL HIDDEN +b int(11) YES NULL INVISIBLE create table t2(a int , b int invisible default 5); insert into t1 values(1); insert into t1(a,b) values(2,2); @@ -20,7 +20,7 @@ a b desc t2; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES 5 HIDDEN +b int(11) YES 5 INVISIBLE connection slave; select * from t1; a @@ -37,7 +37,7 @@ a b desc t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL HIDDEN +b int(11) YES NULL INVISIBLE show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -51,7 +51,7 @@ a b desc t2; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES 5 HIDDEN +b int(11) YES 5 INVISIBLE show create table t2; Table Create Table t2 CREATE TABLE `t2` ( diff --git a/mysql-test/r/hidden_field.result b/mysql-test/r/hidden_field.result index faac9f5ef2b..5a358b8c0ec 100644 --- a/mysql-test/r/hidden_field.result +++ b/mysql-test/r/hidden_field.result @@ -1,32 +1,32 @@ FLUSH STATUS; -create table t1(abc int primary key, xyz int hidden); -SHOW STATUS LIKE 'Feature_hidden_columns'; +create table t1(abc int primary key, xyz int invisible); +SHOW STATUS LIKE 'Feature_invisible_columns'; Variable_name Value -Feature_hidden_columns 1 desc t1; Field Type Null Key Default Extra abc int(11) NO PRI NULL -xyz int(11) YES NULL HIDDEN +xyz int(11) YES NULL INVISIBLE show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `abc` int(11) NOT NULL, + `xyz` int(11) HIDDEN DEFAULT NULL, PRIMARY KEY (`abc`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from INFORMATION_SCHEMA.COLUMNS where TABLE_SCHEMA='test' and TABLE_NAME='t1'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION def test t1 abc 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI select,insert,update,references NEVER NULL -def test t1 xyz 2 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) HIDDEN select,insert,update,references NEVER NULL +def test t1 xyz 2 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) INVISIBLE select,insert,update,references NEVER NULL drop table t1; -create table t1(a1 int hidden); +create table t1(a1 int invisible); ERROR 42000: A table must have at least 1 column -create table t1(a1 blob,hidden(a1)); +create table t1(a1 blob,invisible(a1)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(a1))' at line 1 -create table t1(a1 int primary key hidden ,a2 int unique hidden , a3 blob,a4 int not null hidden unique); +create table t1(a1 int primary key invisible ,a2 int unique invisible , a3 blob,a4 int not null invisible unique); ERROR HY000: Hidden column 'a1' must either have a default value or allow null values -create table t1(abc int not null hidden); +create table t1(abc int not null invisible); ERROR HY000: Hidden column 'abc' must either have a default value or allow null values -create table t1(a int hidden, b int); +create table t1(a int invisible, b int); insert into t1 values(1); insert into t1(a) values(2); insert into t1(b) values(3); @@ -58,13 +58,13 @@ NULL NULL NULL drop table t1; -#more complex case of hidden -create table t1(a int , b int hidden , c int hidden auto_increment unique, d blob , e int unique, f int); +#more complex case of invisible +create table t1(a int , b int invisible , c int invisible auto_increment unique, d blob , e int unique, f int); desc t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL HIDDEN -c int(11) NO PRI NULL auto_increment, HIDDEN +b int(11) YES NULL INVISIBLE +c int(11) NO PRI NULL auto_increment, INVISIBLE d blob YES NULL e int(11) YES UNI NULL f int(11) YES NULL @@ -77,13 +77,13 @@ a d e f 1 d blob 3 1 1 d blob 41 1 drop table t1; -create table sdsdsd(a int , b int, hidden(a,b)); +create table sdsdsd(a int , b int, invisible(a,b)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(a,b))' at line 1 -create table t1(a int,abc int as (a mod 3) virtual hidden); +create table t1(a int,abc int as (a mod 3) virtual invisible); desc t1; Field Type Null Key Default Extra a int(11) YES NULL -abc int(11) YES NULL VIRTUAL GENERATED, HIDDEN +abc int(11) YES NULL VIRTUAL GENERATED, INVISIBLE insert into t1 values(1,default); ERROR 21S01: Column count doesn't match value count at row 1 insert into t1 values(1),(22),(233); @@ -98,14 +98,15 @@ a abc 22 1 233 2 drop table t1; -create table t1(abc int primary key hidden auto_increment, a int); +create table t1(abc int primary key invisible auto_increment, a int); desc t1; Field Type Null Key Default Extra -abc int(11) NO PRI NULL auto_increment, HIDDEN +abc int(11) NO PRI NULL auto_increment, INVISIBLE a int(11) YES NULL show create table t1; Table Create Table t1 CREATE TABLE `t1` ( + `abc` int(11) NOT NULL HIDDEN AUTO_INCREMENT, `a` int(11) DEFAULT NULL, PRIMARY KEY (`abc`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -133,7 +134,7 @@ abc a 8 6 drop table t1; create table t1(abc int); -alter table t1 change abc ss int hidden; +alter table t1 change abc ss int invisible; ERROR 42000: A table must have at least 1 column alter table t1 add column xyz int; alter table t1 modify column abc int ; @@ -143,21 +144,21 @@ abc int(11) YES NULL xyz int(11) YES NULL insert into t1 values(22); ERROR 21S01: Column count doesn't match value count at row 1 -alter table t1 modify column abc int hidden; +alter table t1 modify column abc int invisible; desc t1; Field Type Null Key Default Extra -abc int(11) YES NULL HIDDEN +abc int(11) YES NULL INVISIBLE xyz int(11) YES NULL insert into t1 values(12); drop table t1; #some test on copy table structure with table data; -#table with hidden fields and unique keys; -create table t1(a int , b int hidden , c int hidden auto_increment unique, d blob , e int unique, f int); +#table with invisible fields and unique keys; +create table t1(a int , b int invisible , c int invisible auto_increment unique, d blob , e int unique, f int); desc t1; Field Type Null Key Default Extra a int(11) YES NULL -b int(11) YES NULL HIDDEN -c int(11) NO PRI NULL auto_increment, HIDDEN +b int(11) YES NULL INVISIBLE +c int(11) NO PRI NULL auto_increment, INVISIBLE d blob YES NULL e int(11) YES UNI NULL f int(11) YES NULL @@ -176,7 +177,7 @@ a b c d e f 1 NULL 3 d blob 2 1 1 NULL 4 d blob 3 1 1 NULL 5 d blob 41 1 -#this wont copy hidden fields and keys; +#this wont copy invisible fields and keys; create table t2 as select * from t1; desc t2; Field Type Null Key Default Extra @@ -194,7 +195,7 @@ a d e f select a,b,c,d,e,f from t2; ERROR 42S22: Unknown column 'b' in 'field list' drop table t2; -#now this will copy hidden fields +#now this will copy invisible fields create table t2 as select a,b,c,d,e,f from t1; desc t2; Field Type Null Key Default Extra @@ -220,7 +221,7 @@ a b c d e f 1 NULL 5 d blob 41 1 drop table t2,t1; #some test related to copy of data from one table to another; -create table t1(a int , b int hidden , c int hidden auto_increment unique, d blob , e int unique, f int); +create table t1(a int , b int invisible , c int invisible auto_increment unique, d blob , e int unique, f int); insert into t1 values(1,'d blob',1,1),(1,'d blob',11,1),(1,'d blob',2,1),(1,'d blob',3,1),(1,'d blob',41,1); select a,b,c,d,e,f from t1; a b c d e f @@ -229,7 +230,7 @@ a b c d e f 1 NULL 3 d blob 2 1 1 NULL 4 d blob 3 1 1 NULL 5 d blob 41 1 -create table t2(a int , b int hidden , c int hidden , d blob , e int unique, f int); +create table t2(a int , b int invisible , c int invisible , d blob , e int unique, f int); insert into t2 select * from t1; select a,b,c,d,e,f from t2; a b c d e f @@ -249,8 +250,8 @@ a b c d e f 1 NULL 5 d blob 41 1 truncate t2; drop table t1,t2; -#some test related to creating view on table with hidden column; -create table t1(a int , b int hidden , c int hidden auto_increment unique, d blob , e int unique, f int); +#some test related to creating view on table with invisible column; +create table t1(a int , b int invisible , c int invisible auto_increment unique, d blob , e int unique, f int); insert into t1 values(1,'d blob',1,1),(1,'d blob',11,1),(1,'d blob',2,1),(1,'d blob',3,1),(1,'d blob',41,1); create view v as select * from t1; desc v; @@ -266,7 +267,7 @@ a d e f 1 d blob 2 1 1 d blob 3 1 1 d blob 41 1 -#v does not have hidden column; +#v does not have invisible column; select a,b,c,d,e,f from v; ERROR 42S22: Unknown column 'b' in 'field list' insert into v values(1,21,32,4); @@ -298,7 +299,7 @@ a b c d e f 1 NULL 4 d blob 3 1 1 NULL 5 d blob 41 1 1 NULL 6 21 32 4 -#v does have hidden column but they aren't hidden anymore. +#v does have invisible column but they aren't invisible anymore. select a,b,c,d,e,f from v; a b c d e f 1 NULL 1 d blob 1 1 @@ -330,8 +331,8 @@ a b c d e f 1 32 31 41 5 6 drop view v; drop table t1; -#now hidden column in where and some join query -create table t1 (a int unique , b int hidden unique, c int unique hidden); +#now invisible column in where and some join query +create table t1 (a int unique , b int invisible unique, c int unique invisible); insert into t1(a,b,c) values(1,1,1); insert into t1(a,b,c) values(2,2,2); insert into t1(a,b,c) values(3,3,3); @@ -371,20 +372,22 @@ a a b c 3 3 3 3 4 4 4 4 drop table t1,t2; -#Unhide hidden columns -create table t1 (a int primary key, b int hidden, c int hidden unique); +#Unhide invisible columns +create table t1 (a int primary key, b int invisible, c int invisible unique); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, + `b` int(11) HIDDEN DEFAULT NULL, + `c` int(11) HIDDEN DEFAULT NULL, PRIMARY KEY (`a`), UNIQUE KEY `c` (`c`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 desc t1; Field Type Null Key Default Extra a int(11) NO PRI NULL -b int(11) YES NULL HIDDEN -c int(11) YES UNI NULL HIDDEN +b int(11) YES NULL INVISIBLE +c int(11) YES UNI NULL INVISIBLE alter table t1 modify column b int; desc t1; Field Type Null Key Default Extra @@ -398,20 +401,19 @@ a int(11) NO PRI NULL b int(11) YES NULL d int(11) YES UNI NULL drop table t1; -SHOW STATUS LIKE 'Feature_hidden_columns'; +SHOW STATUS LIKE 'Feature_invisible_columns'; Variable_name Value -Feature_hidden_columns 44 -#hidden is non reserved -create table t1(a int unique , hidden int hidden, c int ); +#invisible is non reserved +create table t1(a int unique , invisible int invisible, c int ); desc t1; Field Type Null Key Default Extra a int(11) YES UNI NULL -hidden int(11) YES NULL HIDDEN +invisible int(11) YES NULL INVISIBLE c int(11) YES NULL -alter table t1 change column hidden hid int hidden; +alter table t1 change column invisible hid int invisible; desc t1; Field Type Null Key Default Extra a int(11) YES UNI NULL -hid int(11) YES NULL HIDDEN +hid int(11) YES NULL INVISIBLE c int(11) YES NULL drop table t1; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 3dd7810171a..50eb926679c 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5656,7 +5656,7 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables, { if (buf.length()) buf.append(STRING_WITH_LEN(",")); - buf.append(STRING_WITH_LEN(" HIDDEN"),cs); + buf.append(STRING_WITH_LEN(" INVISIBLE"),cs); } table->field[17]->store(buf.ptr(), buf.length(), cs); table->field[19]->store(field->comment.str, field->comment.length, cs); |