Merge pull request #68074 from ClickHouse/backport/24.3/67953

Backport #67953 to 24.3: Add an explicit error for `ALTER MODIFY SQL SECURITY` on non-view tables.
This commit is contained in:
robot-ch-test-poll3 2024-08-09 05:02:05 +02:00 committed by GitHub
commit c6b1ccf544
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View File

@ -3108,6 +3108,10 @@ void MergeTreeData::checkAlterIsPossible(const AlterCommands & commands, Context
throw Exception(ErrorCodes::NOT_IMPLEMENTED,
"ALTER MODIFY REFRESH is not supported by MergeTree engines family");
if (command.type == AlterCommand::MODIFY_SQL_SECURITY)
throw Exception(ErrorCodes::NOT_IMPLEMENTED,
"ALTER MODIFY SQL SECURITY is not supported by MergeTree engines family");
if (command.type == AlterCommand::MODIFY_ORDER_BY && !is_custom_partitioned)
{
throw Exception(ErrorCodes::BAD_ARGUMENTS,

View File

@ -27,6 +27,7 @@ OK
OK
100
100
OK
===== TestGrants =====
OK
OK

View File

@ -199,6 +199,8 @@ ${CLICKHOUSE_CLIENT} --user $user2 --query "INSERT INTO source SELECT * FROM gen
${CLICKHOUSE_CLIENT} --query "SELECT count() FROM destination1"
${CLICKHOUSE_CLIENT} --query "SELECT count() FROM destination2"
(( $(${CLICKHOUSE_CLIENT} --query "ALTER TABLE test_table MODIFY SQL SECURITY INVOKER" 2>&1 | grep -c "is not supported") >= 1 )) && echo "OK" || echo "UNEXPECTED"
echo "===== TestGrants ====="
${CLICKHOUSE_CLIENT} --query "GRANT CREATE ON *.* TO $user1"
${CLICKHOUSE_CLIENT} --query "GRANT SELECT ON $db.test_table TO $user1, $user2"