ClickHouse / ClickHouse/ClickHouse

Cannot read from MV without SELECT privileges on Source table (SQL SECURITY)

Open
#64,335 2 comments 0 reactions 0 assignees View on GitHub
comp-materialized-view unexpected behaviour
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

If source table doesn't have SELECT privilege for DEFINER user, then any user can't read data from MV (not target).

Steps to reproduce:
```
pastila https://pastila.nl/?0071145c/d862152c9e1bea40efc7cee13e66352c#LG7ES2e24rNOGW0sBOGfsw== | clickhouse-client -n --echo
```

Result:
```
Code: 497. DB::Exception: Received from localhost:9000. DB::Exception: user_: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(s) ON test.src. (ACCESS_DENIED)
(query: SELECT * FROM mv2; )
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.