mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Fix varieties and curiosities
This commit is contained in:
parent
afdfe35526
commit
6c9e7073c7
@ -893,7 +893,7 @@ def test_required_privileges():
|
||||
instance.query("GRANT BACKUP ON test.table TO u1")
|
||||
instance.query(f"BACKUP TABLE test.table TO {backup_name}", user="u1")
|
||||
|
||||
expected_error = "necessary to have the grant INSERT, CREATE TABLE ON test.table"
|
||||
expected_error = "necessary to have the grant INSERT, CREATE TABLE ON test.`table`"
|
||||
assert expected_error in instance.query_and_get_error(
|
||||
f"RESTORE TABLE test.table FROM {backup_name}", user="u1"
|
||||
)
|
||||
@ -910,7 +910,7 @@ def test_required_privileges():
|
||||
|
||||
instance.query("DROP TABLE test.table")
|
||||
|
||||
expected_error = "necessary to have the grant INSERT, CREATE TABLE ON test.table"
|
||||
expected_error = "necessary to have the grant INSERT, CREATE TABLE ON test.`table`"
|
||||
assert expected_error in instance.query_and_get_error(
|
||||
f"RESTORE ALL FROM {backup_name}", user="u1"
|
||||
)
|
||||
@ -984,7 +984,7 @@ def test_system_users():
|
||||
|
||||
assert (
|
||||
instance.query("SHOW CREATE USER u1")
|
||||
== "CREATE USER u1 IDENTIFIED WITH sha256_password SETTINGS PROFILE default, custom_a = 1\n"
|
||||
== "CREATE USER u1 IDENTIFIED WITH sha256_password SETTINGS PROFILE `default`, custom_a = 1\n"
|
||||
)
|
||||
assert instance.query("SHOW GRANTS FOR u1") == TSV(
|
||||
["GRANT SELECT ON test.* TO u1", "GRANT r2 TO u1"]
|
||||
|
@ -397,7 +397,7 @@ def test_introspection():
|
||||
[
|
||||
"CREATE USER A",
|
||||
"CREATE USER B",
|
||||
"CREATE USER default IDENTIFIED WITH plaintext_password SETTINGS PROFILE default",
|
||||
"CREATE USER default IDENTIFIED WITH plaintext_password SETTINGS PROFILE `default`",
|
||||
]
|
||||
)
|
||||
|
||||
@ -457,7 +457,7 @@ def test_introspection():
|
||||
expected_access1 = (
|
||||
"CREATE USER A\n"
|
||||
"CREATE USER B\n"
|
||||
"CREATE USER default IDENTIFIED WITH plaintext_password SETTINGS PROFILE default"
|
||||
"CREATE USER default IDENTIFIED WITH plaintext_password SETTINGS PROFILE `default`"
|
||||
)
|
||||
expected_access2 = (
|
||||
"GRANT SELECT ON test.`table` TO A\n"
|
||||
@ -558,7 +558,7 @@ def test_grant_with_replace_option():
|
||||
)
|
||||
|
||||
expected_error = (
|
||||
"it's necessary to have the grant INSERT ON test.table WITH GRANT OPTION"
|
||||
"it's necessary to have the grant INSERT ON test.`table` WITH GRANT OPTION"
|
||||
)
|
||||
assert expected_error in instance.query_and_get_error(
|
||||
"GRANT INSERT ON test.`table` TO B WITH REPLACE OPTION", user="A"
|
||||
|
@ -247,7 +247,7 @@ def test_create_table():
|
||||
"CREATE TABLE table7 (`x` int) ENGINE = S3('http://minio1:9001/root/data/test5.csv.gz', 'minio', '[HIDDEN]', 'CSV', 'gzip')",
|
||||
"CREATE TABLE table8 (`x` int) ENGINE = MySQL(named_collection_1, host = 'mysql80', port = 3306, database = 'mysql_db', `table` = 'mysql_table', user = 'mysql_user', password = '[HIDDEN]')",
|
||||
"CREATE TABLE table9 (`x` int) ENGINE = MySQL(named_collection_2, database = 'mysql_db', host = 'mysql80', port = 3306, password = '[HIDDEN]', `table` = 'mysql_table', user = 'mysql_user')",
|
||||
"CREATE TABLE table10 (x int) ENGINE = MySQL(named_collection_3, database = 'mysql_db', host = 'mysql80', port = 3306, `table` = 'mysql_table')",
|
||||
"CREATE TABLE table10 (x int) ENGINE = MySQL(named_collection_3, database = 'mysql_db', host = 'mysql80', port = 3306, table = 'mysql_table')",
|
||||
"CREATE TABLE table11 (`x` int) ENGINE = PostgreSQL(named_collection_4, host = 'postgres1', port = 5432, database = 'postgres_db', `table` = 'postgres_table', user = 'postgres_user', password = '[HIDDEN]')",
|
||||
"CREATE TABLE table12 (`x` int) ENGINE = MongoDB(named_collection_5, host = 'mongo1', port = 5432, db = 'mongo_db', collection = 'mongo_col', user = 'mongo_user', password = '[HIDDEN]'",
|
||||
"CREATE TABLE table13 (`x` int) ENGINE = S3(named_collection_6, url = 'http://minio1:9001/root/data/test8.csv', access_key_id = 'minio', secret_access_key = '[HIDDEN]', format = 'CSV')",
|
||||
|
@ -802,10 +802,10 @@ def test_tags_with_db_and_table_names():
|
||||
|
||||
assert node.query("SHOW CREATE POLICIES default") == TSV(
|
||||
[
|
||||
"CREATE ROW POLICY default ON mydb.`table` FOR SELECT USING a = 0 TO default",
|
||||
"CREATE ROW POLICY default ON mydb.`.filtered_table4` FOR SELECT USING c = 2 TO default",
|
||||
"CREATE ROW POLICY default ON mydb.filtered_table2 FOR SELECT USING c > (d + 5) TO default",
|
||||
"CREATE ROW POLICY default ON mydb.filtered_table3 FOR SELECT USING c = 0 TO default",
|
||||
"CREATE ROW POLICY default ON mydb.`table` FOR SELECT USING a = 0 TO default",
|
||||
]
|
||||
)
|
||||
|
||||
|
@ -318,7 +318,7 @@ SHOW ACCESS
|
||||
```
|
||||
**result**
|
||||
```
|
||||
CREATE USER default IDENTIFIED WITH plaintext_password SETTINGS PROFILE default
|
||||
CREATE USER default IDENTIFIED WITH plaintext_password SETTINGS PROFILE `default`
|
||||
CREATE SETTINGS PROFILE default SETTINGS max_memory_usage = 10000000000, load_balancing = 'random'
|
||||
CREATE SETTINGS PROFILE readonly SETTINGS readonly = 1
|
||||
CREATE QUOTA default KEYED BY user_name FOR INTERVAL 1 hour TRACKING ONLY TO default
|
||||
|
Loading…
Reference in New Issue
Block a user