为什么在 ClickHouse 中未显式修改时会抛出“无法在只读模式下修改设置”?

Win*_* Z. 4 settings readonly clickhouse

当抛出以下异常时,应用程序正在使用只读用户:

<Error> HTTPHandler: Code: 164, e.displayText() = DB::Exception: Cannot modify 'result_overflow_mode' setting in readonly mode
Run Code Online (Sandbox Code Playgroud)

我看了ClickHouse代码,发现当查询带有 时set setting,如果用户是只读的,就会抛出这个错误。

我检查了我的只读用户的配置users.xml,发现max_result_rows/bytesresult_overflow_mode没有主动设置。

但是,我的查询不符合set setting.

那么什么逻辑触发了这个设置的改变呢?

mnv*_*mnv 6

尝试指定<readonly>2</readonly>.

\n\n

readonly参数说明:https: //clickhouse.tech/docs/en/operations/settings/permissions_for_queries/#settings_readonly

\n\n
\n

Possible values:
\n 0 \xe2\x80\x94 All queries are allowed.
\n 1 \xe2\x80\x94 Only read data queries are allowed.
\n 2 \xe2\x80\x94 Read data and change settings queries are allowed.

\n
\n\n

So, with readonly=2 you are let to you client to set result_overflow_mode but dont let to execute inserts and other requests of modifying data.

\n