mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
Prepend slash to path for system.zookeeper queries
path should starts with '/', otherwise ZBADARGUMENTS will be thrown in ZooKeeper::sendThread and the session will fail.
This commit is contained in:
parent
d5c2008c7d
commit
176ebb26e0
@ -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