Skip to content

Commit

Permalink
Use getSetting function to retrieve setting as suggested in #866
Browse files Browse the repository at this point in the history
  • Loading branch information
zhicwu committed Mar 14, 2022
1 parent 6977c17 commit 37d261b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ protected static ClickHouseRecord getServerInfo(ClickHouseNode node, ClickHouseR
try (ClickHouseResponse response = newReq.option(ClickHouseClientOption.ASYNC, false)
.option(ClickHouseClientOption.COMPRESS, false).option(ClickHouseClientOption.DECOMPRESS, false)
.option(ClickHouseClientOption.FORMAT, ClickHouseFormat.RowBinaryWithNamesAndTypes)
.query("select currentUser(), timezone(), version(), "
+ "ifnull((select toUInt8(value) from system.settings where name='readonly'),0) readonly "
.query("select currentUser(), timezone(), version(), getSetting('readonly') readonly "
+ "FORMAT RowBinaryWithNamesAndTypes")
.execute().get()) {
return response.firstRecord();
Expand Down

0 comments on commit 37d261b

Please sign in to comment.