mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Add exceptions during substitution processing if node already has a value
This commit is contained in:
parent
e3842ebc89
commit
9edcdf41d5
@ -522,6 +522,9 @@ void ConfigProcessor::doIncludesRecursive(
|
|||||||
|
|
||||||
if (attr_nodes["from_zk"]) /// we have zookeeper subst
|
if (attr_nodes["from_zk"]) /// we have zookeeper subst
|
||||||
{
|
{
|
||||||
|
if (node->hasChildNodes()) /// only allow substitution for nodes with no value
|
||||||
|
throw Poco::Exception("Element <" + node->nodeName() + "> has value, can't process from_zk substitution");
|
||||||
|
|
||||||
contributing_zk_paths.insert(attr_nodes["from_zk"]->getNodeValue());
|
contributing_zk_paths.insert(attr_nodes["from_zk"]->getNodeValue());
|
||||||
|
|
||||||
if (zk_node_cache)
|
if (zk_node_cache)
|
||||||
@ -544,6 +547,9 @@ void ConfigProcessor::doIncludesRecursive(
|
|||||||
|
|
||||||
if (attr_nodes["from_env"]) /// we have env subst
|
if (attr_nodes["from_env"]) /// we have env subst
|
||||||
{
|
{
|
||||||
|
if (node->hasChildNodes()) /// only allow substitution for nodes with no value
|
||||||
|
throw Poco::Exception("Element <" + node->nodeName() + "> has value, can't process from_env substitution");
|
||||||
|
|
||||||
XMLDocumentPtr env_document;
|
XMLDocumentPtr env_document;
|
||||||
auto get_env_node = [&](const std::string & name) -> const Node *
|
auto get_env_node = [&](const std::string & name) -> const Node *
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user