mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Backport #69985 to 24.9: Fix parsing for definers
This commit is contained in:
parent
4ed0de28c6
commit
b68bf12d1a
@ -68,7 +68,7 @@ bool ParserSQLSecurity::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (!definer && s_definer.ignore(pos, expected))
|
||||
if (!definer && !is_definer_current_user && s_definer.ignore(pos, expected))
|
||||
{
|
||||
s_eq.ignore(pos, expected);
|
||||
if (s_current_user.ignore(pos, expected))
|
||||
|
@ -29,6 +29,7 @@ OK
|
||||
100
|
||||
100
|
||||
OK
|
||||
Syntax error
|
||||
===== TestGrants =====
|
||||
OK
|
||||
OK
|
||||
|
@ -208,6 +208,14 @@ ${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"
|
||||
|
||||
(( $(${CLICKHOUSE_CLIENT} --user $user1 --query "
|
||||
CREATE VIEW $db.test_view_broken
|
||||
SQL SECURITY DEFINER
|
||||
DEFINER CURRENT_USER
|
||||
DEFINER $user2
|
||||
AS SELECT * FROM $db.test_table;
|
||||
" 2>&1 | grep -c "Syntax error") >= 1 )) && echo "Syntax error" || echo "UNEXPECTED"
|
||||
|
||||
echo "===== TestGrants ====="
|
||||
${CLICKHOUSE_CLIENT} --query "GRANT CREATE ON *.* TO $user1"
|
||||
${CLICKHOUSE_CLIENT} --query "GRANT SELECT ON $db.test_table TO $user1, $user2"
|
||||
|
Loading…
Reference in New Issue
Block a user