Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming queries fail when user is readonly type 1 #67

Open
frabarz opened this issue Mar 30, 2023 · 0 comments
Open

Streaming queries fail when user is readonly type 1 #67

frabarz opened this issue Mar 30, 2023 · 0 comments

Comments

@frabarz
Copy link

frabarz commented Mar 30, 2023

I'm using a database where I don't have access to the user settings. The provided user has a readonly profile with the <readonly>1</readonly> setting.
I'm using a Cursor with _stream_results set to True and not modifying the default _max_row_buffer value.
When executing the query, the server returns this error:

Code: 164.
DB::Exception: Cannot modify 'max_block_size' setting in readonly mode

One solution would be change the user readonly setting to <readonly>2</readonly>, which allows using settings, but I can't do that. The other is simply not sending settings with the query.
Looking at the source of Cursor._prepare, it always sets the "max_block_size" key in the settings when _stream_results is True. When I commented this line and tried again, the query executed without issues.

I'm wondering if there's a way to avoid using settings by passing a parameter or maybe reading the connection string, since it's something directly related to the user used in it. Clickhouse used to have the ?readonly=2 connection parameter, but I think it was removed some versions ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant