mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Merge pull request #70081 from ClickHouse/backport/24.8/69985
Backport #69985 to 24.8: Fix parsing for definers
This commit is contained in:
commit
ad92f57223
@ -68,7 +68,7 @@ bool ParserSQLSecurity::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
|||||||
|
|
||||||
while (true)
|
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);
|
s_eq.ignore(pos, expected);
|
||||||
if (s_current_user.ignore(pos, expected))
|
if (s_current_user.ignore(pos, expected))
|
||||||
|
@ -29,6 +29,7 @@ OK
|
|||||||
100
|
100
|
||||||
100
|
100
|
||||||
OK
|
OK
|
||||||
|
Syntax error
|
||||||
===== TestGrants =====
|
===== TestGrants =====
|
||||||
OK
|
OK
|
||||||
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} --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 ====="
|
echo "===== TestGrants ====="
|
||||||
${CLICKHOUSE_CLIENT} --query "GRANT CREATE ON *.* TO $user1"
|
${CLICKHOUSE_CLIENT} --query "GRANT CREATE ON *.* TO $user1"
|
||||||
${CLICKHOUSE_CLIENT} --query "GRANT SELECT ON $db.test_table TO $user1, $user2"
|
${CLICKHOUSE_CLIENT} --query "GRANT SELECT ON $db.test_table TO $user1, $user2"
|
||||||
|
Loading…
Reference in New Issue
Block a user