You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enhancementjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)queriesArea: how the client builds and runs statements (parameters, quoting, batches)sql-parserDetail: the SQL parser of the JDBC driver (v1 and v2)
Currently, our SET ROLE feature is not complete.
A full sysntax SET ROLE {DEFAULT | NONE | role [,...] | ALL | ALL EXCEPT role [,...]}
Let's go over to complete the implementation.
Recommendation: Keep open — implementation needed
jdbc-v2 applies only SET ROLE <role>[, ...]. DEFAULT, ALL, and ALL EXCEPT make the next queries fail, and NONE keeps the default roles active. No open PR.
Status on main: Not supported on main — a jdbc-v2 program on main (8480ca001), ClickHouse 26.11.2.4, user with roles r1, r2 and default role r2: SET ROLE r1 and SET ROLE r1, r2 give those roles; SET ROLE NONE gives ['r2']; after DEFAULT, ALL, and ALL EXCEPT r1, the next query fails with UNKNOWN_ROLE for the roles DEFAULT, ALL, and ALLEXCEPTr1.
Breaking change: No — can be done without a break.
Duplicates / related: None found.
Analysis: The parser takes all text after ROLE as role names: ClickHouseSqlParser.jj:134 splits it at commas and drops the whitespace, so ALL EXCEPT r1 becomes one role ALLEXCEPTr1, and StatementImpl.java:429 sends these names with each later query of the connection. For NONE, SqlParserFacade.java:218-224 clears the list, so later queries send no role and the server applies the user's default roles.
Automated triage by Polyglot AI. A maintainer makes the final decision.
enhancementjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)queriesArea: how the client builds and runs statements (parameters, quoting, batches)sql-parserDetail: the SQL parser of the JDBC driver (v1 and v2)
Activity
polyglotAI-bot commentedon Nov 28, 2026
Recommendation: Keep open — implementation needed
jdbc-v2 applies only
SET ROLE <role>[, ...].DEFAULT,ALL, andALL EXCEPTmake the next queries fail, andNONEkeeps the default roles active. No open PR.main: Not supported on main — a jdbc-v2 program onmain(8480ca001), ClickHouse 26.11.2.4, user with rolesr1,r2and default roler2:SET ROLE r1andSET ROLE r1, r2give those roles;SET ROLE NONEgives['r2']; afterDEFAULT,ALL, andALL EXCEPT r1, the next query fails withUNKNOWN_ROLEfor the rolesDEFAULT,ALL, andALLEXCEPTr1.Analysis: The parser takes all text after
ROLEas role names:ClickHouseSqlParser.jj:134splits it at commas and drops the whitespace, soALL EXCEPT r1becomes one roleALLEXCEPTr1, andStatementImpl.java:429sends these names with each later query of the connection. ForNONE,SqlParserFacade.java:218-224clears the list, so later queries send no role and the server applies the user's default roles.Automated triage by Polyglot AI. A maintainer makes the final decision.