mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
add config and fix style check
This commit is contained in:
parent
7870e02fdf
commit
5693e6212d
@ -584,6 +584,8 @@ static constexpr UInt64 operator""_GiB(unsigned long long value)
|
|||||||
\
|
\
|
||||||
M(Bool, allow_unrestricted_reads_from_keeper, false, "Allow unrestricted (without condition on path) reads from system.zookeeper table, can be handy, but is not safe for zookeeper", 0) \
|
M(Bool, allow_unrestricted_reads_from_keeper, false, "Allow unrestricted (without condition on path) reads from system.zookeeper table, can be handy, but is not safe for zookeeper", 0) \
|
||||||
\
|
\
|
||||||
|
M(Bool, allow_writes_to_zookeeper, false, "Allow writes to system.zookeeper table, can be handy, but is not safe for zookeeper", 0) \
|
||||||
|
\
|
||||||
/** Experimental functions */ \
|
/** Experimental functions */ \
|
||||||
M(Bool, allow_experimental_funnel_functions, false, "Enable experimental functions for funnel analysis.", 0) \
|
M(Bool, allow_experimental_funnel_functions, false, "Enable experimental functions for funnel analysis.", 0) \
|
||||||
M(Bool, allow_experimental_nlp_functions, false, "Enable experimental functions for natural language processing.", 0) \
|
M(Bool, allow_experimental_nlp_functions, false, "Enable experimental functions for natural language processing.", 0) \
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <limits.h>
|
#include <climits>
|
||||||
|
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
@ -130,7 +130,8 @@ public:
|
|||||||
throw Exception("Column `name` should not be empty", ErrorCodes::BAD_ARGUMENTS);
|
throw Exception("Column `name` should not be empty", ErrorCodes::BAD_ARGUMENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path.size() + name.size() > PATH_MAX) {
|
if (path.size() + name.size() > PATH_MAX)
|
||||||
|
{
|
||||||
throw Exception("Sum of `name` length and `path` length should not exceed PATH_MAX", ErrorCodes::BAD_ARGUMENTS);
|
throw Exception("Sum of `name` length and `path` length should not exceed PATH_MAX", ErrorCodes::BAD_ARGUMENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,6 +152,8 @@ public:
|
|||||||
|
|
||||||
SinkToStoragePtr StorageSystemZooKeeper::write(const ASTPtr &, const StorageMetadataPtr &, ContextPtr context)
|
SinkToStoragePtr StorageSystemZooKeeper::write(const ASTPtr &, const StorageMetadataPtr &, ContextPtr context)
|
||||||
{
|
{
|
||||||
|
if (!context->getSettingsRef().allow_writes_to_zookeeper)
|
||||||
|
throw Exception("Prohibit writing to system.zookeeper unless `set allow_writes_to_zookeeper = 'true'`", ErrorCodes::BAD_ARGUMENTS);
|
||||||
Block write_header;
|
Block write_header;
|
||||||
write_header.insert(ColumnWithTypeAndName(std::make_shared<DataTypeString>(), "name"));
|
write_header.insert(ColumnWithTypeAndName(std::make_shared<DataTypeString>(), "name"));
|
||||||
write_header.insert(ColumnWithTypeAndName(std::make_shared<DataTypeString>(), "value"));
|
write_header.insert(ColumnWithTypeAndName(std::make_shared<DataTypeString>(), "value"));
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
-- Tags: zookeeper
|
-- Tags: zookeeper
|
||||||
|
|
||||||
|
insert into system.zookeeper (name, path, value) values ('a', '/b', 'y'); -- { serverError 36 }
|
||||||
|
|
||||||
set allow_unrestricted_reads_from_keeper = 'true';
|
set allow_unrestricted_reads_from_keeper = 'true';
|
||||||
|
set allow_writes_to_zookeeper = 'true';
|
||||||
|
|
||||||
drop table if exists test_zkinsert;
|
drop table if exists test_zkinsert;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user