mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
Merge pull request #11613 from azat/system.zookeeper-path-prepend-slash
Prepend slash for path while querying system.zookeeper
This commit is contained in:
commit
fc8da2abd3
@ -112,8 +112,13 @@ void StorageSystemZooKeeper::fillData(MutableColumns & res_columns, const Contex
|
||||
|
||||
zkutil::ZooKeeperPtr zookeeper = context.getZooKeeper();
|
||||
|
||||
String path_corrected;
|
||||
/// path should starts with '/', otherwise ZBADARGUMENTS will be thrown in
|
||||
/// ZooKeeper::sendThread and the session will fail.
|
||||
if (path[0] != '/')
|
||||
path_corrected = '/';
|
||||
path_corrected += path;
|
||||
/// In all cases except the root, path must not end with a slash.
|
||||
String path_corrected = path;
|
||||
if (path_corrected != "/" && path_corrected.back() == '/')
|
||||
path_corrected.resize(path_corrected.size() - 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user