Unverified 提交 3bc437a2 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov 提交者: GitHub

Merge pull request #1394 from katzyn/meta

Add INFORMATION_SCHEMA.COLUMNS.IS_VISIBLE
...@@ -21,6 +21,12 @@ Change Log ...@@ -21,6 +21,12 @@ Change Log
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul> <ul>
<li>Issue #1393: Add INFORMATION_SCHEMA.COLUMNS.IS_VISIBLE
</li>
<li>PR #1392: Some refactoring and assorted minor optimizations
</li>
<li>PR #1388: Extract UnaryOperation from Operation and other changes
</li>
<li>PR #1386: DISK_SPACE_USED() for MVStore and other minor changes <li>PR #1386: DISK_SPACE_USED() for MVStore and other minor changes
</li> </li>
<li>PR #1385: split up the rather large convertTo method <li>PR #1385: split up the rather large convertTo method
......
...@@ -189,7 +189,8 @@ public class MetaTable extends Table { ...@@ -189,7 +189,8 @@ public class MetaTable extends Table {
"REMARKS", "REMARKS",
"SOURCE_DATA_TYPE SMALLINT", "SOURCE_DATA_TYPE SMALLINT",
"COLUMN_TYPE", "COLUMN_TYPE",
"COLUMN_ON_UPDATE" "COLUMN_ON_UPDATE",
"IS_VISIBLE"
); );
indexColumnName = "TABLE_NAME"; indexColumnName = "TABLE_NAME";
break; break;
...@@ -923,7 +924,9 @@ public class MetaTable extends Table { ...@@ -923,7 +924,9 @@ public class MetaTable extends Table {
// COLUMN_TYPE // COLUMN_TYPE
createSQLWithoutName, createSQLWithoutName,
// COLUMN_ON_UPDATE // COLUMN_ON_UPDATE
c.getOnUpdateSQL() c.getOnUpdateSQL(),
// IS_VISIBLE
ValueBoolean.get(c.getVisible())
); );
} }
} }
......
...@@ -9,13 +9,13 @@ create memory table orders ( orderid varchar(10), name varchar(20), customer_id ...@@ -9,13 +9,13 @@ create memory table orders ( orderid varchar(10), name varchar(20), customer_id
> ok > ok
select * from information_schema.columns where table_name = 'ORDERS'; select * from information_schema.columns where table_name = 'ORDERS';
> 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_PRECISION_RADIX NUMERIC_SCALE DATETIME_PRECISION INTERVAL_TYPE INTERVAL_PRECISION CHARACTER_SET_NAME COLLATION_NAME TYPE_NAME NULLABLE IS_COMPUTED SELECTIVITY CHECK_CONSTRAINT SEQUENCE_NAME REMARKS SOURCE_DATA_TYPE COLUMN_TYPE COLUMN_ON_UPDATE > 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_PRECISION_RADIX NUMERIC_SCALE DATETIME_PRECISION INTERVAL_TYPE INTERVAL_PRECISION CHARACTER_SET_NAME COLLATION_NAME TYPE_NAME NULLABLE IS_COMPUTED SELECTIVITY CHECK_CONSTRAINT SEQUENCE_NAME REMARKS SOURCE_DATA_TYPE COLUMN_TYPE COLUMN_ON_UPDATE IS_VISIBLE
> ------------- ------------ ---------- ----------- ---------------- -------------- ----------- --------- ------------------------ ---------------------- ----------------- ----------------------- ------------- ------------------ ------------- ------------------ ------------------ -------------- --------- -------- ----------- ----------- ---------------- ------------- ------- ---------------- ------------------- ---------------- > ------------- ------------ ---------- ----------- ---------------- -------------- ----------- --------- ------------------------ ---------------------- ----------------- ----------------------- ------------- ------------------ ------------- ------------------ ------------------ -------------- --------- -------- ----------- ----------- ---------------- ------------- ------- ---------------- ------------------- ---------------- ----------
> SCRIPT PUBLIC ORDERS COMPLETED 4 null NO 3 1 1 1 10 0 null null null Unicode OFF DECIMAL 0 FALSE 50 null null NUMERIC(1) NOT NULL null > SCRIPT PUBLIC ORDERS COMPLETED 4 null NO 3 1 1 1 10 0 null null null Unicode OFF DECIMAL 0 FALSE 50 null null NUMERIC(1) NOT NULL null TRUE
> SCRIPT PUBLIC ORDERS CUSTOMER_ID 3 null YES 12 10 10 10 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(10) null > SCRIPT PUBLIC ORDERS CUSTOMER_ID 3 null YES 12 10 10 10 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(10) null TRUE
> SCRIPT PUBLIC ORDERS NAME 2 null YES 12 20 20 20 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(20) null > SCRIPT PUBLIC ORDERS NAME 2 null YES 12 20 20 20 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(20) null TRUE
> SCRIPT PUBLIC ORDERS ORDERID 1 null YES 12 10 10 10 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(10) null > SCRIPT PUBLIC ORDERS ORDERID 1 null YES 12 10 10 10 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(10) null TRUE
> SCRIPT PUBLIC ORDERS VERIFIED 5 null YES 3 1 1 1 10 0 null null null Unicode OFF DECIMAL 1 FALSE 50 null null NUMERIC(1) null > SCRIPT PUBLIC ORDERS VERIFIED 5 null YES 3 1 1 1 10 0 null null null Unicode OFF DECIMAL 1 FALSE 50 null null NUMERIC(1) null TRUE
> rows: 5 > rows: 5
drop table orders; drop table orders;
......
...@@ -9,13 +9,13 @@ create memory table orders ( orderid varchar(10), name varchar(20), customer_id ...@@ -9,13 +9,13 @@ create memory table orders ( orderid varchar(10), name varchar(20), customer_id
> ok > ok
select * from information_schema.columns where table_name = 'ORDERS'; select * from information_schema.columns where table_name = 'ORDERS';
> 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_PRECISION_RADIX NUMERIC_SCALE DATETIME_PRECISION INTERVAL_TYPE INTERVAL_PRECISION CHARACTER_SET_NAME COLLATION_NAME TYPE_NAME NULLABLE IS_COMPUTED SELECTIVITY CHECK_CONSTRAINT SEQUENCE_NAME REMARKS SOURCE_DATA_TYPE COLUMN_TYPE COLUMN_ON_UPDATE > 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_PRECISION_RADIX NUMERIC_SCALE DATETIME_PRECISION INTERVAL_TYPE INTERVAL_PRECISION CHARACTER_SET_NAME COLLATION_NAME TYPE_NAME NULLABLE IS_COMPUTED SELECTIVITY CHECK_CONSTRAINT SEQUENCE_NAME REMARKS SOURCE_DATA_TYPE COLUMN_TYPE COLUMN_ON_UPDATE IS_VISIBLE
> ------------- ------------ ---------- ----------- ---------------- -------------- ----------- --------- ------------------------ ---------------------- ----------------- ----------------------- ------------- ------------------ ------------- ------------------ ------------------ -------------- --------- -------- ----------- ----------- ---------------- ------------- ------- ---------------- ------------------- ---------------- > ------------- ------------ ---------- ----------- ---------------- -------------- ----------- --------- ------------------------ ---------------------- ----------------- ----------------------- ------------- ------------------ ------------- ------------------ ------------------ -------------- --------- -------- ----------- ----------- ---------------- ------------- ------- ---------------- ------------------- ---------------- ----------
> SCRIPT PUBLIC ORDERS COMPLETED 4 null NO 2 1 1 1 10 0 null null null Unicode OFF NUMERIC 0 FALSE 50 null null NUMERIC(1) NOT NULL null > SCRIPT PUBLIC ORDERS COMPLETED 4 null NO 2 1 1 1 10 0 null null null Unicode OFF NUMERIC 0 FALSE 50 null null NUMERIC(1) NOT NULL null TRUE
> SCRIPT PUBLIC ORDERS CUSTOMER_ID 3 null YES 12 10 10 10 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(10) null > SCRIPT PUBLIC ORDERS CUSTOMER_ID 3 null YES 12 10 10 10 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(10) null TRUE
> SCRIPT PUBLIC ORDERS NAME 2 null YES 12 20 20 20 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(20) null > SCRIPT PUBLIC ORDERS NAME 2 null YES 12 20 20 20 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(20) null TRUE
> SCRIPT PUBLIC ORDERS ORDERID 1 null YES 12 10 10 10 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(10) null > SCRIPT PUBLIC ORDERS ORDERID 1 null YES 12 10 10 10 10 0 null null null Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(10) null TRUE
> SCRIPT PUBLIC ORDERS VERIFIED 5 null YES 2 1 1 1 10 0 null null null Unicode OFF NUMERIC 1 FALSE 50 null null NUMERIC(1) null > SCRIPT PUBLIC ORDERS VERIFIED 5 null YES 2 1 1 1 10 0 null null null Unicode OFF NUMERIC 1 FALSE 50 null null NUMERIC(1) null TRUE
> rows: 5 > rows: 5
drop table orders; drop table orders;
......
...@@ -242,13 +242,13 @@ SELECT * FROM V3; ...@@ -242,13 +242,13 @@ SELECT * FROM V3;
>> -1 >> -1
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'E' ORDER BY TABLE_NAME; SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'E' ORDER BY TABLE_NAME;
> 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_PRECISION_RADIX NUMERIC_SCALE DATETIME_PRECISION INTERVAL_TYPE INTERVAL_PRECISION CHARACTER_SET_NAME COLLATION_NAME TYPE_NAME NULLABLE IS_COMPUTED SELECTIVITY CHECK_CONSTRAINT SEQUENCE_NAME REMARKS SOURCE_DATA_TYPE COLUMN_TYPE COLUMN_ON_UPDATE > 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_PRECISION_RADIX NUMERIC_SCALE DATETIME_PRECISION INTERVAL_TYPE INTERVAL_PRECISION CHARACTER_SET_NAME COLLATION_NAME TYPE_NAME NULLABLE IS_COMPUTED SELECTIVITY CHECK_CONSTRAINT SEQUENCE_NAME REMARKS SOURCE_DATA_TYPE COLUMN_TYPE COLUMN_ON_UPDATE IS_VISIBLE
> ------------- ------------ ---------- ----------- ---------------- -------------- ----------- --------- ------------------------ ---------------------- ----------------- ----------------------- ------------- ------------------ ------------- ------------------ ------------------ -------------- --------- -------- ----------- ----------- ---------------- ------------- ------- ---------------- ------------- ---------------- > ------------- ------------ ---------- ----------- ---------------- -------------- ----------- --------- ------------------------ ---------------------- ----------------- ----------------------- ------------- ------------------ ------------- ------------------ ------------------ -------------- --------- -------- ----------- ----------- ---------------- ------------- ------- ---------------- ------------- ---------------- ----------
> SCRIPT PUBLIC TEST E 1 null YES 1111 2147483647 2147483647 2147483647 10 0 null null null Unicode OFF ENUM 1 FALSE 50 null null ENUM('A','B') null > SCRIPT PUBLIC TEST E 1 null YES 1111 2147483647 2147483647 2147483647 10 0 null null null Unicode OFF ENUM 1 FALSE 50 null null ENUM('A','B') null TRUE
> SCRIPT PUBLIC V E 1 null YES 1111 2147483647 2147483647 2147483647 10 0 null null null Unicode OFF ENUM 1 FALSE 50 null null ENUM('A','B') null > SCRIPT PUBLIC V E 1 null YES 1111 2147483647 2147483647 2147483647 10 0 null null null Unicode OFF ENUM 1 FALSE 50 null null ENUM('A','B') null TRUE
> SCRIPT PUBLIC V1 E 1 null YES 4 2147483647 2147483647 2147483647 10 0 null null null Unicode OFF INTEGER 1 FALSE 50 null null INTEGER null > SCRIPT PUBLIC V1 E 1 null YES 4 2147483647 2147483647 2147483647 10 0 null null null Unicode OFF INTEGER 1 FALSE 50 null null INTEGER null TRUE
> SCRIPT PUBLIC V2 E 1 null YES 4 2147483647 2147483647 2147483647 10 0 null null null Unicode OFF INTEGER 1 FALSE 50 null null INTEGER null > SCRIPT PUBLIC V2 E 1 null YES 4 2147483647 2147483647 2147483647 10 0 null null null Unicode OFF INTEGER 1 FALSE 50 null null INTEGER null TRUE
> SCRIPT PUBLIC V3 E 1 null YES 4 2147483647 2147483647 2147483647 10 0 null null null Unicode OFF INTEGER 1 FALSE 50 null null INTEGER null > SCRIPT PUBLIC V3 E 1 null YES 4 2147483647 2147483647 2147483647 10 0 null null null Unicode OFF INTEGER 1 FALSE 50 null null INTEGER null TRUE
> rows (ordered): 5 > rows (ordered): 5
DROP VIEW V; DROP VIEW V;
......
...@@ -72,3 +72,26 @@ DROP TABLE T2; ...@@ -72,3 +72,26 @@ DROP TABLE T2;
DROP TABLE T1; DROP TABLE T1;
> ok > ok
CREATE TABLE TEST(A INT, B INT INVISIBLE);
> ok
SELECT * FROM TEST;
> A
> -
> rows: 0
SELECT A, B FROM TEST;
> A B
> - -
> rows: 0
SELECT COLUMN_NAME, IS_VISIBLE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'TEST' ORDER BY ORDINAL_POSITION;
> COLUMN_NAME IS_VISIBLE
> ----------- ----------
> A TRUE
> B FALSE
> rows (ordered): 2
DROP TABLE TEST;
> ok
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论