mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 11:22:12 +00:00
Add more tests.
This commit is contained in:
parent
9247b3278d
commit
94f4b4d57f
@ -5,3 +5,6 @@ Nothing dropped
|
|||||||
Nothing dropped, mode=replace
|
Nothing dropped, mode=replace
|
||||||
Nothing dropped, mode=create
|
Nothing dropped, mode=create
|
||||||
ACCESS_ENTITY_ALREADY_EXISTS
|
ACCESS_ENTITY_ALREADY_EXISTS
|
||||||
|
Everything dropped, restore system.roles, then system.users
|
||||||
|
user_a 0
|
||||||
|
role_b 1
|
||||||
|
@ -71,3 +71,26 @@ do_check
|
|||||||
echo "Nothing dropped, mode=create"
|
echo "Nothing dropped, mode=create"
|
||||||
${CLICKHOUSE_CLIENT} --query "RESTORE ALL FROM ${backup_name} SETTINGS create_access='create' FORMAT Null" 2>&1 | grep -om1 "ACCESS_ENTITY_ALREADY_EXISTS"
|
${CLICKHOUSE_CLIENT} --query "RESTORE ALL FROM ${backup_name} SETTINGS create_access='create' FORMAT Null" 2>&1 | grep -om1 "ACCESS_ENTITY_ALREADY_EXISTS"
|
||||||
do_check
|
do_check
|
||||||
|
|
||||||
|
echo "Everything dropped, restore system.roles, then system.users"
|
||||||
|
${CLICKHOUSE_CLIENT} --query "DROP USER ${user_a}"
|
||||||
|
${CLICKHOUSE_CLIENT} --query "DROP ROLE ${role_b}"
|
||||||
|
${CLICKHOUSE_CLIENT} --query "RESTORE TABLE system.roles FROM ${backup_name} FORMAT Null"
|
||||||
|
${CLICKHOUSE_CLIENT} --query "SELECT 'user_a', count() FROM system.users WHERE name = '${user_a}'"
|
||||||
|
${CLICKHOUSE_CLIENT} --query "SELECT 'role_b', count() FROM system.roles WHERE name = '${role_b}'"
|
||||||
|
${CLICKHOUSE_CLIENT} --query "RESTORE TABLE system.users FROM ${backup_name} FORMAT Null"
|
||||||
|
do_check
|
||||||
|
|
||||||
|
# TODO: Cannot restore system.users, then system.roles correctly. The result after the second RESTORE ALL is the following:
|
||||||
|
# CREATE USER user_a IDENTIFIED WITH no_password DEFAULT ROLE NONE SETTINGS custom_x = 2; CREATE ROLE role_b SETTINGS custom_x = 1
|
||||||
|
# because there is no `role_b` at the time when `user_a` is restored,
|
||||||
|
# and no information about the default role and the grant at the time when `role_b` is restored.
|
||||||
|
#
|
||||||
|
# echo "Everything dropped, restore system.users, then system.roles"
|
||||||
|
# ${CLICKHOUSE_CLIENT} --query "DROP USER ${user_a}"
|
||||||
|
# ${CLICKHOUSE_CLIENT} --query "DROP ROLE ${role_b}"
|
||||||
|
# ${CLICKHOUSE_CLIENT} --query "RESTORE TABLE system.users FROM ${backup_name} SETTINGS allow_unresolved_access_dependencies=true FORMAT Null"
|
||||||
|
# ${CLICKHOUSE_CLIENT} --query "SELECT 'user_a', count() FROM system.users WHERE name = '${user_a}'"
|
||||||
|
# ${CLICKHOUSE_CLIENT} --query "SELECT 'role_b', count() FROM system.roles WHERE name = '${role_b}'"
|
||||||
|
# ${CLICKHOUSE_CLIENT} --query "RESTORE TABLE system.roles FROM ${backup_name} SETTINGS update_access_entities_dependents=true FORMAT Null"
|
||||||
|
# do_check
|
||||||
|
Loading…
Reference in New Issue
Block a user