mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Fix create or drop of sql user defined functions in readonly mode
This commit is contained in:
parent
bacee7f19c
commit
d1a4550b4f
@ -445,10 +445,11 @@ bool ContextAccess::checkAccessImplHelper(AccessFlags flags, const Args &... arg
|
|||||||
const AccessFlags dictionary_ddl = AccessType::CREATE_DICTIONARY | AccessType::DROP_DICTIONARY;
|
const AccessFlags dictionary_ddl = AccessType::CREATE_DICTIONARY | AccessType::DROP_DICTIONARY;
|
||||||
const AccessFlags function_ddl = AccessType::CREATE_FUNCTION | AccessType::DROP_FUNCTION;
|
const AccessFlags function_ddl = AccessType::CREATE_FUNCTION | AccessType::DROP_FUNCTION;
|
||||||
const AccessFlags table_and_dictionary_ddl = table_ddl | dictionary_ddl;
|
const AccessFlags table_and_dictionary_ddl = table_ddl | dictionary_ddl;
|
||||||
|
const AccessFlags table_and_dictionary_and_function_ddl = table_ddl | dictionary_ddl | function_ddl;
|
||||||
const AccessFlags write_table_access = AccessType::INSERT | AccessType::OPTIMIZE;
|
const AccessFlags write_table_access = AccessType::INSERT | AccessType::OPTIMIZE;
|
||||||
const AccessFlags write_dcl_access = AccessType::ACCESS_MANAGEMENT - AccessType::SHOW_ACCESS;
|
const AccessFlags write_dcl_access = AccessType::ACCESS_MANAGEMENT - AccessType::SHOW_ACCESS;
|
||||||
|
|
||||||
const AccessFlags not_readonly_flags = write_table_access | table_and_dictionary_ddl | write_dcl_access | AccessType::SYSTEM | AccessType::KILL_QUERY;
|
const AccessFlags not_readonly_flags = write_table_access | table_and_dictionary_and_function_ddl | write_dcl_access | AccessType::SYSTEM | AccessType::KILL_QUERY;
|
||||||
const AccessFlags not_readonly_1_flags = AccessType::CREATE_TEMPORARY_TABLE;
|
const AccessFlags not_readonly_1_flags = AccessType::CREATE_TEMPORARY_TABLE;
|
||||||
|
|
||||||
const AccessFlags ddl_flags = table_ddl | dictionary_ddl | function_ddl;
|
const AccessFlags ddl_flags = table_ddl | dictionary_ddl | function_ddl;
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
1
|
7
tests/queries/0_stateless/02315_readonly_create_function.sh
Executable file
7
tests/queries/0_stateless/02315_readonly_create_function.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=none
|
||||||
|
|
||||||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
# shellcheck source=../shell_config.sh
|
||||||
|
. "$CURDIR"/../shell_config.sh
|
||||||
|
|
||||||
|
$CLICKHOUSE_CLIENT --readonly 1 --query "CREATE FUNCTION test_function AS (x) -> x + 1;" 2>&1 | grep -c -F 'Code: 164'
|
Loading…
Reference in New Issue
Block a user