ClickHouse / clickhouse-java

ClickHouse Java Clients & JDBC Driver
https://clickhouse.com
Apache License 2.0
1.45k stars 535 forks source link

JDBC role persistence breaks querying with custom settings prefixes enabled #1843

Closed phantom943 closed 1 month ago

phantom943 commented 1 month ago

Describe the bug

After role persistence has been released in PR https://github.com/ClickHouse/clickhouse-java/pull/1569, the JDBC connector is broken after issuing a SET ROLE command, if you have custom_settings_prefixes enabled.

Steps to reproduce

  1. Have <custom_settings_prefixes>my_prefix</custom_settings_prefixes> set in Clickhouse server settings
  2. Execute command SET ROLE test_role
  3. Execute command SELECT 1.
  4. Observe error Code: 115. DB::Exception: Setting role is neither a builtin setting nor started with the prefix 'my_prefix' registered for user-defined settings.

Expected behaviour

Both commands run successfully

Configuration

Environment

ClickHouse server

phantom943 commented 1 month ago

@chernser you might probably want to look into this, if you have some spare time.

phantom943 commented 1 month ago

Fixed by upgrading Clickhouse to the latest available version (24.9.1.3278 atm). It seems the changes for role granting haven't yet landed in the version that I was using.