mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 02:21:59 +00:00
Update tests
This commit is contained in:
parent
8406a0353a
commit
31562c5ab6
@ -4,12 +4,12 @@ B
|
||||
C
|
||||
GRANT INSERT, ALTER DELETE ON *.* TO test_user_01073
|
||||
GRANT SELECT ON db1.* TO test_user_01073
|
||||
GRANT SELECT ON db2.table TO test_user_01073
|
||||
GRANT SELECT(col1) ON db3.table TO test_user_01073
|
||||
GRANT SELECT(col1, col2) ON db4.table TO test_user_01073
|
||||
GRANT SELECT ON db2.`table` TO test_user_01073
|
||||
GRANT SELECT(col1) ON db3.`table` TO test_user_01073
|
||||
GRANT SELECT(col1, col2) ON db4.`table` TO test_user_01073
|
||||
D
|
||||
GRANT ALTER DELETE ON *.* TO test_user_01073
|
||||
GRANT SELECT(col1) ON db4.table TO test_user_01073
|
||||
GRANT SELECT(col1) ON db4.`table` TO test_user_01073
|
||||
E
|
||||
GRANT SELECT ON db1.* TO test_role_01073
|
||||
REVOKE SELECT(c1, c2, c3, c4, c5) ON db1.table1 FROM test_role_01073
|
||||
|
@ -4,21 +4,21 @@ REVOKE SELECT ON db.* FROM test_user_01074
|
||||
--cleanup
|
||||
--simple 2
|
||||
GRANT SELECT ON db.* TO test_user_01074
|
||||
REVOKE SELECT ON db.table FROM test_user_01074
|
||||
REVOKE SELECT ON db.`table` FROM test_user_01074
|
||||
--cleanup
|
||||
--simple 3
|
||||
GRANT SELECT ON db.table TO test_user_01074
|
||||
REVOKE SELECT(col1) ON db.table FROM test_user_01074
|
||||
GRANT SELECT ON db.`table` TO test_user_01074
|
||||
REVOKE SELECT(col1) ON db.`table` FROM test_user_01074
|
||||
--cleanup
|
||||
--complex 1
|
||||
GRANT SELECT ON *.* TO test_user_01074
|
||||
REVOKE SELECT(col1, col2) ON db.table FROM test_user_01074
|
||||
REVOKE SELECT(col1, col2) ON db.`table` FROM test_user_01074
|
||||
--cleanup
|
||||
--complex 2
|
||||
GRANT SELECT ON *.* TO test_user_01074
|
||||
REVOKE SELECT ON db.* FROM test_user_01074
|
||||
GRANT SELECT ON db.table TO test_user_01074
|
||||
REVOKE SELECT(col1) ON db.table FROM test_user_01074
|
||||
GRANT SELECT ON db.`table` TO test_user_01074
|
||||
REVOKE SELECT(col1) ON db.`table` FROM test_user_01074
|
||||
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
|
||||
┃ [1muser_name [0m ┃ [1mrole_name[0m ┃ [1maccess_type[0m ┃ [1mdatabase[0m ┃ [1mtable[0m ┃ [1mcolumn[0m ┃ [1mis_partial_revoke[0m ┃ [1mgrant_option[0m ┃
|
||||
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
|
||||
@ -40,7 +40,7 @@ GRANT SELECT ON *.* TO test_user_01074
|
||||
--cleanup
|
||||
--grant option 1
|
||||
GRANT SELECT ON *.* TO test_user_01074 WITH GRANT OPTION
|
||||
REVOKE GRANT OPTION FOR SELECT(col1) ON db.table FROM test_user_01074
|
||||
REVOKE GRANT OPTION FOR SELECT(col1) ON db.`table` FROM test_user_01074
|
||||
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
|
||||
┃ [1muser_name [0m ┃ [1mrole_name[0m ┃ [1maccess_type[0m ┃ [1mdatabase[0m ┃ [1mtable[0m ┃ [1mcolumn[0m ┃ [1mis_partial_revoke[0m ┃ [1mgrant_option[0m ┃
|
||||
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
|
||||
@ -51,7 +51,7 @@ REVOKE GRANT OPTION FOR SELECT(col1) ON db.table FROM test_user_01074
|
||||
--cleanup
|
||||
--grant option 2
|
||||
GRANT SELECT ON *.* TO test_user_01074 WITH GRANT OPTION
|
||||
REVOKE SELECT(col1) ON db.table FROM test_user_01074
|
||||
REVOKE SELECT(col1) ON db.`table` FROM test_user_01074
|
||||
--cleanup
|
||||
--grant option 3
|
||||
GRANT SELECT ON *.* TO test_user_01074
|
||||
|
@ -1,7 +1,7 @@
|
||||
SELECT
|
||||
a,
|
||||
b AS x
|
||||
FROM table AS t
|
||||
FROM `table` AS t
|
||||
INNER JOIN table2 AS t2 ON t.id = t2.t_id
|
||||
WHERE 1 = 1
|
||||
;
|
||||
|
@ -1,35 +1,35 @@
|
||||
-- default
|
||||
CREATE ROW POLICY p1_01295 ON db.table
|
||||
CREATE ROW POLICY p1_01295 ON db.`table`
|
||||
-- same as default
|
||||
CREATE ROW POLICY p2_01295 ON db.table
|
||||
CREATE ROW POLICY p3_01295 ON db.table
|
||||
CREATE ROW POLICY p2_01295 ON db.`table`
|
||||
CREATE ROW POLICY p3_01295 ON db.`table`
|
||||
-- rename
|
||||
CREATE ROW POLICY p2_01295_renamed ON db.table
|
||||
CREATE ROW POLICY p2_01295_renamed ON db.`table`
|
||||
-- filter
|
||||
CREATE ROW POLICY p1_01295 ON db.table FOR SELECT USING (a < b) AND (c > d)
|
||||
CREATE ROW POLICY p2_01295 ON db.table AS restrictive FOR SELECT USING id = currentUser()
|
||||
CREATE ROW POLICY p3_01295 ON db.table FOR SELECT USING 1
|
||||
CREATE ROW POLICY p1_01295 ON db.table AS restrictive FOR SELECT USING 0
|
||||
CREATE ROW POLICY p1_01295 ON db.`table` FOR SELECT USING (a < b) AND (c > d)
|
||||
CREATE ROW POLICY p2_01295 ON db.`table` AS restrictive FOR SELECT USING id = currentUser()
|
||||
CREATE ROW POLICY p3_01295 ON db.`table` FOR SELECT USING 1
|
||||
CREATE ROW POLICY p1_01295 ON db.`table` AS restrictive FOR SELECT USING 0
|
||||
-- to roles
|
||||
CREATE ROW POLICY p1_01295 ON db.table
|
||||
CREATE ROW POLICY p2_01295 ON db.table TO ALL
|
||||
CREATE ROW POLICY p3_01295 ON db.table TO r1_01295
|
||||
CREATE ROW POLICY p4_01295 ON db.table TO u1_01295
|
||||
CREATE ROW POLICY p5_01295 ON db.table TO r1_01295, u1_01295
|
||||
CREATE ROW POLICY p6_01295 ON db.table TO ALL EXCEPT r1_01295
|
||||
CREATE ROW POLICY p7_01295 ON db.table TO ALL EXCEPT r1_01295, u1_01295
|
||||
CREATE ROW POLICY p1_01295 ON db.table TO u1_01295
|
||||
CREATE ROW POLICY p2_01295 ON db.table
|
||||
CREATE ROW POLICY p1_01295 ON db.`table`
|
||||
CREATE ROW POLICY p2_01295 ON db.`table` TO ALL
|
||||
CREATE ROW POLICY p3_01295 ON db.`table` TO r1_01295
|
||||
CREATE ROW POLICY p4_01295 ON db.`table` TO u1_01295
|
||||
CREATE ROW POLICY p5_01295 ON db.`table` TO r1_01295, u1_01295
|
||||
CREATE ROW POLICY p6_01295 ON db.`table` TO ALL EXCEPT r1_01295
|
||||
CREATE ROW POLICY p7_01295 ON db.`table` TO ALL EXCEPT r1_01295, u1_01295
|
||||
CREATE ROW POLICY p1_01295 ON db.`table` TO u1_01295
|
||||
CREATE ROW POLICY p2_01295 ON db.`table`
|
||||
-- multiple policies in one command
|
||||
CREATE ROW POLICY p1_01295 ON db.table FOR SELECT USING 1
|
||||
CREATE ROW POLICY p2_01295 ON db.table FOR SELECT USING 1
|
||||
CREATE ROW POLICY p3_01295 ON db.table TO u1_01295
|
||||
CREATE ROW POLICY p1_01295 ON db.`table` FOR SELECT USING 1
|
||||
CREATE ROW POLICY p2_01295 ON db.`table` FOR SELECT USING 1
|
||||
CREATE ROW POLICY p3_01295 ON db.`table` TO u1_01295
|
||||
CREATE ROW POLICY p3_01295 ON db2.table2 TO u1_01295
|
||||
CREATE ROW POLICY p4_01295 ON db.table FOR SELECT USING a = b
|
||||
CREATE ROW POLICY p4_01295 ON db.`table` FOR SELECT USING a = b
|
||||
CREATE ROW POLICY p5_01295 ON db2.table2 FOR SELECT USING a = b
|
||||
CREATE ROW POLICY p1_01295 ON db.table FOR SELECT USING 1 TO ALL
|
||||
CREATE ROW POLICY p2_01295 ON db.table FOR SELECT USING 1 TO ALL
|
||||
CREATE ROW POLICY p1_01295 ON db.`table` FOR SELECT USING 1 TO ALL
|
||||
CREATE ROW POLICY p2_01295 ON db.`table` FOR SELECT USING 1 TO ALL
|
||||
-- system.row_policies
|
||||
p1_01295 ON db.table p1_01295 db table local_directory (a < b) AND (c > d) 0 0 [] []
|
||||
p2_01295 ON db.table p2_01295 db table local_directory id = currentUser() 1 0 ['u1_01295'] []
|
||||
p3_01295 ON db.table p3_01295 db table local_directory 1 0 1 [] ['r1_01295']
|
||||
p1_01295 ON db.`table` p1_01295 db table local_directory (a < b) AND (c > d) 0 0 [] []
|
||||
p2_01295 ON db.`table` p2_01295 db table local_directory id = currentUser() 1 0 ['u1_01295'] []
|
||||
p3_01295 ON db.`table` p3_01295 db table local_directory 1 0 1 [] ['r1_01295']
|
||||
|
@ -1,20 +1,20 @@
|
||||
-- one policy
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.table
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.table
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.table FOR SELECT USING 1
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.table FOR SELECT USING 1
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.`table`
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.`table`
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.`table` FOR SELECT USING 1
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.`table` FOR SELECT USING 1
|
||||
-- multiple policies
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.table FOR SELECT USING 1
|
||||
CREATE ROW POLICY p2_01296 ON db_01296.table FOR SELECT USING 1
|
||||
CREATE ROW POLICY p3_01296 ON db_01296.table TO u1_01296
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.`table` FOR SELECT USING 1
|
||||
CREATE ROW POLICY p2_01296 ON db_01296.`table` FOR SELECT USING 1
|
||||
CREATE ROW POLICY p3_01296 ON db_01296.`table` TO u1_01296
|
||||
CREATE ROW POLICY p3_01296 ON db_01296.table2 TO u1_01296
|
||||
CREATE ROW POLICY p4_01296 ON db_01296.table FOR SELECT USING a = b
|
||||
CREATE ROW POLICY p4_01296 ON db_01296.`table` FOR SELECT USING a = b
|
||||
CREATE ROW POLICY p5_01296 ON db_01296.table2 FOR SELECT USING a = b
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.table FOR SELECT USING 1
|
||||
CREATE ROW POLICY p2_01296 ON db_01296.table FOR SELECT USING 1
|
||||
CREATE ROW POLICY p3_01296 ON db_01296.table TO u1_01296
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.`table` FOR SELECT USING 1
|
||||
CREATE ROW POLICY p2_01296 ON db_01296.`table` FOR SELECT USING 1
|
||||
CREATE ROW POLICY p3_01296 ON db_01296.`table` TO u1_01296
|
||||
CREATE ROW POLICY p3_01296 ON db_01296.table2 TO u1_01296
|
||||
CREATE ROW POLICY p4_01296 ON db_01296.table FOR SELECT USING a = b
|
||||
CREATE ROW POLICY p4_01296 ON db_01296.`table` FOR SELECT USING a = b
|
||||
CREATE ROW POLICY p5_01296 ON db_01296.table2 FOR SELECT USING a = b
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.table FOR SELECT USING 1 TO ALL
|
||||
CREATE ROW POLICY p2_01296 ON db_01296.table FOR SELECT USING 1 TO ALL
|
||||
CREATE ROW POLICY p1_01296 ON db_01296.`table` FOR SELECT USING 1 TO ALL
|
||||
CREATE ROW POLICY p2_01296 ON db_01296.`table` FOR SELECT USING 1 TO ALL
|
||||
|
@ -3,4 +3,4 @@ CREATE MATERIALIZED VIEW test_1602.vv\n(\n `EventDate` DateTime,\n `Counte
|
||||
CREATE VIEW test_1602.VIEW\n(\n `EventDate` DateTime,\n `CounterID` UInt32,\n `UserID` UInt32\n) AS\nSELECT *\nFROM test_1602.tbl
|
||||
CREATE VIEW test_1602.DATABASE\n(\n `EventDate` DateTime,\n `CounterID` UInt32,\n `UserID` UInt32\n) AS\nSELECT *\nFROM test_1602.tbl
|
||||
CREATE VIEW test_1602.DICTIONARY\n(\n `EventDate` DateTime,\n `CounterID` UInt32,\n `UserID` UInt32\n) AS\nSELECT *\nFROM test_1602.tbl
|
||||
CREATE VIEW test_1602.TABLE\n(\n `EventDate` DateTime,\n `CounterID` UInt32,\n `UserID` UInt32\n) AS\nSELECT *\nFROM test_1602.tbl
|
||||
CREATE VIEW test_1602.`TABLE`\n(\n `EventDate` DateTime,\n `CounterID` UInt32,\n `UserID` UInt32\n) AS\nSELECT *\nFROM test_1602.tbl
|
||||
|
@ -4,12 +4,12 @@ B
|
||||
GRANT SELECT ON db1.* TO test_user_01999
|
||||
GRANT SHOW TABLES, SHOW COLUMNS, SHOW DICTIONARIES ON db2.tb2 TO test_user_01999
|
||||
C
|
||||
GRANT SELECT(col1) ON db3.table TO test_user_01999
|
||||
GRANT SELECT(col1) ON db3.`table` TO test_user_01999
|
||||
D
|
||||
GRANT SELECT(col3) ON db3.table3 TO test_user_01999
|
||||
GRANT SELECT(col1, col2) ON db4.table4 TO test_user_01999
|
||||
E
|
||||
GRANT SELECT(cola) ON db5.table TO test_user_01999
|
||||
GRANT SELECT(cola) ON db5.`table` TO test_user_01999
|
||||
GRANT INSERT(colb) ON db6.tb61 TO test_user_01999
|
||||
GRANT SHOW ON db7.* TO test_user_01999
|
||||
F
|
||||
|
@ -1,2 +1,2 @@
|
||||
CREATE TABLE default.table\n(\n `key` String\n)\nENGINE = File(\'TSVWithNamesAndTypes\', \'/dev/null\')
|
||||
CREATE TABLE foo.table\n(\n `key` String\n)\nENGINE = File(\'TSVWithNamesAndTypes\', \'/dev/null\')
|
||||
CREATE TABLE default.`table`\n(\n `key` String\n)\nENGINE = File(\'TSVWithNamesAndTypes\', \'/dev/null\')
|
||||
CREATE TABLE foo.`table`\n(\n `key` String\n)\nENGINE = File(\'TSVWithNamesAndTypes\', \'/dev/null\')
|
||||
|
@ -1,3 +1,3 @@
|
||||
DESCRIBE TABLE file('data.csv')
|
||||
DESCRIBE TABLE table
|
||||
DESCRIBE TABLE `table`
|
||||
DESCRIBE TABLE file('data.csv')
|
||||
|
@ -1,5 +1,5 @@
|
||||
CREATE DATABASE INFORMATION_SCHEMA\nENGINE = Memory
|
||||
CREATE VIEW INFORMATION_SCHEMA.COLUMNS\n(\n `table_catalog` String,\n `table_schema` String,\n `table_name` String,\n `column_name` String,\n `ordinal_position` UInt64,\n `column_default` String,\n `is_nullable` String,\n `data_type` String,\n `character_maximum_length` Nullable(UInt64),\n `character_octet_length` Nullable(UInt64),\n `numeric_precision` Nullable(UInt64),\n `numeric_precision_radix` Nullable(UInt64),\n `numeric_scale` Nullable(UInt64),\n `datetime_precision` Nullable(UInt64),\n `character_set_catalog` Nullable(String),\n `character_set_schema` Nullable(String),\n `character_set_name` Nullable(String),\n `collation_catalog` Nullable(String),\n `collation_schema` Nullable(String),\n `collation_name` Nullable(String),\n `domain_catalog` Nullable(String),\n `domain_schema` Nullable(String),\n `domain_name` Nullable(String),\n `extra` Nullable(String),\n `column_comment` String,\n `column_type` String,\n `TABLE_CATALOG` String,\n `TABLE_SCHEMA` String,\n `TABLE_NAME` String,\n `COLUMN_NAME` String,\n `ORDINAL_POSITION` UInt64,\n `COLUMN_DEFAULT` String,\n `IS_NULLABLE` String,\n `DATA_TYPE` String,\n `CHARACTER_MAXIMUM_LENGTH` Nullable(UInt64),\n `CHARACTER_OCTET_LENGTH` Nullable(UInt64),\n `NUMERIC_PRECISION` Nullable(UInt64),\n `NUMERIC_PRECISION_RADIX` Nullable(UInt64),\n `NUMERIC_SCALE` Nullable(UInt64),\n `DATETIME_PRECISION` Nullable(UInt64),\n `CHARACTER_SET_CATALOG` Nullable(String),\n `CHARACTER_SET_SCHEMA` Nullable(String),\n `CHARACTER_SET_NAME` Nullable(String),\n `COLLATION_CATALOG` Nullable(String),\n `COLLATION_SCHEMA` Nullable(String),\n `COLLATION_NAME` Nullable(String),\n `DOMAIN_CATALOG` Nullable(String),\n `DOMAIN_SCHEMA` Nullable(String),\n `DOMAIN_NAME` Nullable(String),\n `EXTRA` Nullable(String),\n `COLUMN_COMMENT` String,\n `COLUMN_TYPE` String\n) AS\nSELECT\n database AS table_catalog,\n database AS table_schema,\n table AS table_name,\n name AS column_name,\n position AS ordinal_position,\n default_expression AS column_default,\n type LIKE \'Nullable(%)\' AS is_nullable,\n type AS data_type,\n character_octet_length AS character_maximum_length,\n character_octet_length,\n numeric_precision,\n numeric_precision_radix,\n numeric_scale,\n datetime_precision,\n NULL AS character_set_catalog,\n NULL AS character_set_schema,\n NULL AS character_set_name,\n NULL AS collation_catalog,\n NULL AS collation_schema,\n NULL AS collation_name,\n NULL AS domain_catalog,\n NULL AS domain_schema,\n NULL AS domain_name,\n multiIf(default_kind = \'DEFAULT\', \'DEFAULT_GENERATED\', default_kind = \'MATERIALIZED\', \'STORED GENERATED\', default_kind = \'ALIAS\', \'VIRTUAL GENERATED\', \'\') AS extra,\n comment AS column_comment,\n type AS column_type,\n table_catalog AS TABLE_CATALOG,\n table_schema AS TABLE_SCHEMA,\n table_name AS TABLE_NAME,\n column_name AS COLUMN_NAME,\n ordinal_position AS ORDINAL_POSITION,\n column_default AS COLUMN_DEFAULT,\n is_nullable AS IS_NULLABLE,\n data_type AS DATA_TYPE,\n character_maximum_length AS CHARACTER_MAXIMUM_LENGTH,\n character_octet_length AS CHARACTER_OCTET_LENGTH,\n numeric_precision AS NUMERIC_PRECISION,\n numeric_precision_radix AS NUMERIC_PRECISION_RADIX,\n numeric_scale AS NUMERIC_SCALE,\n datetime_precision AS DATETIME_PRECISION,\n character_set_catalog AS CHARACTER_SET_CATALOG,\n character_set_schema AS CHARACTER_SET_SCHEMA,\n character_set_name AS CHARACTER_SET_NAME,\n collation_catalog AS COLLATION_CATALOG,\n collation_schema AS COLLATION_SCHEMA,\n collation_name AS COLLATION_NAME,\n domain_catalog AS DOMAIN_CATALOG,\n domain_schema AS DOMAIN_SCHEMA,\n domain_name AS DOMAIN_NAME,\n extra AS EXTRA,\n column_comment AS COLUMN_COMMENT,\n column_type AS COLUMN_TYPE\nFROM system.columns
|
||||
CREATE VIEW INFORMATION_SCHEMA.COLUMNS\n(\n `table_catalog` String,\n `table_schema` String,\n `table_name` String,\n `column_name` String,\n `ordinal_position` UInt64,\n `column_default` String,\n `is_nullable` String,\n `data_type` String,\n `character_maximum_length` Nullable(UInt64),\n `character_octet_length` Nullable(UInt64),\n `numeric_precision` Nullable(UInt64),\n `numeric_precision_radix` Nullable(UInt64),\n `numeric_scale` Nullable(UInt64),\n `datetime_precision` Nullable(UInt64),\n `character_set_catalog` Nullable(String),\n `character_set_schema` Nullable(String),\n `character_set_name` Nullable(String),\n `collation_catalog` Nullable(String),\n `collation_schema` Nullable(String),\n `collation_name` Nullable(String),\n `domain_catalog` Nullable(String),\n `domain_schema` Nullable(String),\n `domain_name` Nullable(String),\n `extra` Nullable(String),\n `column_comment` String,\n `column_type` String,\n `TABLE_CATALOG` String,\n `TABLE_SCHEMA` String,\n `TABLE_NAME` String,\n `COLUMN_NAME` String,\n `ORDINAL_POSITION` UInt64,\n `COLUMN_DEFAULT` String,\n `IS_NULLABLE` String,\n `DATA_TYPE` String,\n `CHARACTER_MAXIMUM_LENGTH` Nullable(UInt64),\n `CHARACTER_OCTET_LENGTH` Nullable(UInt64),\n `NUMERIC_PRECISION` Nullable(UInt64),\n `NUMERIC_PRECISION_RADIX` Nullable(UInt64),\n `NUMERIC_SCALE` Nullable(UInt64),\n `DATETIME_PRECISION` Nullable(UInt64),\n `CHARACTER_SET_CATALOG` Nullable(String),\n `CHARACTER_SET_SCHEMA` Nullable(String),\n `CHARACTER_SET_NAME` Nullable(String),\n `COLLATION_CATALOG` Nullable(String),\n `COLLATION_SCHEMA` Nullable(String),\n `COLLATION_NAME` Nullable(String),\n `DOMAIN_CATALOG` Nullable(String),\n `DOMAIN_SCHEMA` Nullable(String),\n `DOMAIN_NAME` Nullable(String),\n `EXTRA` Nullable(String),\n `COLUMN_COMMENT` String,\n `COLUMN_TYPE` String\n) AS\nSELECT\n database AS table_catalog,\n database AS table_schema,\n `table` AS table_name,\n name AS column_name,\n position AS ordinal_position,\n default_expression AS column_default,\n type LIKE \'Nullable(%)\' AS is_nullable,\n type AS data_type,\n character_octet_length AS character_maximum_length,\n character_octet_length,\n numeric_precision,\n numeric_precision_radix,\n numeric_scale,\n datetime_precision,\n NULL AS character_set_catalog,\n NULL AS character_set_schema,\n NULL AS character_set_name,\n NULL AS collation_catalog,\n NULL AS collation_schema,\n NULL AS collation_name,\n NULL AS domain_catalog,\n NULL AS domain_schema,\n NULL AS domain_name,\n multiIf(default_kind = \'DEFAULT\', \'DEFAULT_GENERATED\', default_kind = \'MATERIALIZED\', \'STORED GENERATED\', default_kind = \'ALIAS\', \'VIRTUAL GENERATED\', \'\') AS extra,\n comment AS column_comment,\n type AS column_type,\n table_catalog AS TABLE_CATALOG,\n table_schema AS TABLE_SCHEMA,\n table_name AS TABLE_NAME,\n column_name AS COLUMN_NAME,\n ordinal_position AS ORDINAL_POSITION,\n column_default AS COLUMN_DEFAULT,\n is_nullable AS IS_NULLABLE,\n data_type AS DATA_TYPE,\n character_maximum_length AS CHARACTER_MAXIMUM_LENGTH,\n character_octet_length AS CHARACTER_OCTET_LENGTH,\n numeric_precision AS NUMERIC_PRECISION,\n numeric_precision_radix AS NUMERIC_PRECISION_RADIX,\n numeric_scale AS NUMERIC_SCALE,\n datetime_precision AS DATETIME_PRECISION,\n character_set_catalog AS CHARACTER_SET_CATALOG,\n character_set_schema AS CHARACTER_SET_SCHEMA,\n character_set_name AS CHARACTER_SET_NAME,\n collation_catalog AS COLLATION_CATALOG,\n collation_schema AS COLLATION_SCHEMA,\n collation_name AS COLLATION_NAME,\n domain_catalog AS DOMAIN_CATALOG,\n domain_schema AS DOMAIN_SCHEMA,\n domain_name AS DOMAIN_NAME,\n extra AS EXTRA,\n column_comment AS COLUMN_COMMENT,\n column_type AS COLUMN_TYPE\nFROM system.columns
|
||||
CREATE VIEW INFORMATION_SCHEMA.TABLES (`table_catalog` String, `table_schema` String, `table_name` String, `table_type` String, `table_rows` Nullable(UInt64), `data_length` Nullable(UInt64), `table_collation` Nullable(String), `table_comment` Nullable(String), `TABLE_CATALOG` String, `TABLE_SCHEMA` String, `TABLE_NAME` String, `TABLE_TYPE` String, `TABLE_ROWS` Nullable(UInt64), `DATA_LENGTH` Nullable(UInt64), `TABLE_COLLATION` Nullable(String), `TABLE_COMMENT` Nullable(String)) AS SELECT database AS table_catalog, database AS table_schema, name AS table_name, multiIf(is_temporary, \'LOCAL TEMPORARY\', engine LIKE \'%View\', \'VIEW\', engine LIKE \'System%\', \'SYSTEM VIEW\', has_own_data = 0, \'FOREIGN TABLE\', \'BASE TABLE\') AS table_type, total_rows AS table_rows, total_bytes AS data_length, \'utf8mb4_0900_ai_ci\' AS table_collation, comment AS table_comment, table_catalog AS TABLE_CATALOG, table_schema AS TABLE_SCHEMA, table_name AS TABLE_NAME, table_type AS TABLE_TYPE, table_rows AS TABLE_ROWS, data_length AS DATA_LENGTH, table_collation AS TABLE_COLLATION, table_comment AS TABLE_COMMENT FROM system.tables
|
||||
CREATE VIEW INFORMATION_SCHEMA.tables (`table_catalog` String, `table_schema` String, `table_name` String, `table_type` String, `table_rows` Nullable(UInt64), `data_length` Nullable(UInt64), `table_collation` Nullable(String), `table_comment` Nullable(String), `TABLE_CATALOG` String, `TABLE_SCHEMA` String, `TABLE_NAME` String, `TABLE_TYPE` String, `TABLE_ROWS` Nullable(UInt64), `DATA_LENGTH` Nullable(UInt64), `TABLE_COLLATION` Nullable(String), `TABLE_COMMENT` Nullable(String)) AS SELECT database AS table_catalog, database AS table_schema, name AS table_name, multiIf(is_temporary, \'LOCAL TEMPORARY\', engine LIKE \'%View\', \'VIEW\', engine LIKE \'System%\', \'SYSTEM VIEW\', has_own_data = 0, \'FOREIGN TABLE\', \'BASE TABLE\') AS table_type, total_rows AS table_rows, total_bytes AS data_length, \'utf8mb4_0900_ai_ci\' AS table_collation, comment AS table_comment, table_catalog AS TABLE_CATALOG, table_schema AS TABLE_SCHEMA, table_name AS TABLE_NAME, table_type AS TABLE_TYPE, table_rows AS TABLE_ROWS, data_length AS DATA_LENGTH, table_collation AS TABLE_COLLATION, table_comment AS TABLE_COMMENT FROM system.tables
|
||||
CREATE VIEW information_schema.TABLES (`table_catalog` String, `table_schema` String, `table_name` String, `table_type` String, `table_rows` Nullable(UInt64), `data_length` Nullable(UInt64), `table_collation` Nullable(String), `table_comment` Nullable(String), `TABLE_CATALOG` String, `TABLE_SCHEMA` String, `TABLE_NAME` String, `TABLE_TYPE` String, `TABLE_ROWS` Nullable(UInt64), `DATA_LENGTH` Nullable(UInt64), `TABLE_COLLATION` Nullable(String), `TABLE_COMMENT` Nullable(String)) AS SELECT database AS table_catalog, database AS table_schema, name AS table_name, multiIf(is_temporary, \'LOCAL TEMPORARY\', engine LIKE \'%View\', \'VIEW\', engine LIKE \'System%\', \'SYSTEM VIEW\', has_own_data = 0, \'FOREIGN TABLE\', \'BASE TABLE\') AS table_type, total_rows AS table_rows, total_bytes AS data_length, \'utf8mb4_0900_ai_ci\' AS table_collation, comment AS table_comment, table_catalog AS TABLE_CATALOG, table_schema AS TABLE_SCHEMA, table_name AS TABLE_NAME, table_type AS TABLE_TYPE, table_rows AS TABLE_ROWS, data_length AS DATA_LENGTH, table_collation AS TABLE_COLLATION, table_comment AS TABLE_COMMENT FROM system.tables
|
||||
|
@ -1,5 +1,5 @@
|
||||
CREATE DICTIONARY default.dict\n(\n `id` UInt32,\n `value` String\n)\nPRIMARY KEY id\nSOURCE(CLICKHOUSE(HOST \'localhost\' PORT 9000 USER \'default\' DB \'default\' TABLE \'view\'))\nLIFETIME(MIN 600 MAX 600)\nLAYOUT(HASHED())
|
||||
CREATE TABLE default.table\n(\n `col` String MATERIALIZED dictGet(\'default.dict\', \'value\', toUInt32(1))\n)\nENGINE = MergeTree\nORDER BY tuple()\nSETTINGS index_granularity = 8192
|
||||
CREATE TABLE default.`table`\n(\n `col` String MATERIALIZED dictGet(\'default.dict\', \'value\', toUInt32(1))\n)\nENGINE = MergeTree\nORDER BY tuple()\nSETTINGS index_granularity = 8192
|
||||
1 v
|
||||
1 v
|
||||
1 v
|
||||
|
@ -3,7 +3,7 @@
|
||||
CREATE ROW POLICY db1_02703 ON db1_02703.* FOR SELECT USING 1 TO ALL
|
||||
-- SHOW CREATE POLICY ON db1_02703.*
|
||||
CREATE ROW POLICY db1_02703 ON db1_02703.* FOR SELECT USING 1 TO ALL
|
||||
CREATE ROW POLICY tbl1_02703 ON db1_02703.table FOR SELECT USING 1 TO ALL
|
||||
CREATE ROW POLICY tbl1_02703 ON db1_02703.`table` FOR SELECT USING 1 TO ALL
|
||||
-- SHOW CREATE POLICY ON db1_02703.`*`
|
||||
R1, R2: (x == 1) OR (x == 2)
|
||||
1
|
||||
|
Loading…
Reference in New Issue
Block a user