From 1727cda24ce6430d0b5e1bf2b2ec1ce861ddac32 Mon Sep 17 00:00:00 2001 From: Mark Shabanov Date: Wed, 20 Nov 2024 16:51:46 +0300 Subject: [PATCH] fix "Unknown error" when configuring regions --- fdbclient/DatabaseConfiguration.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fdbclient/DatabaseConfiguration.cpp b/fdbclient/DatabaseConfiguration.cpp index 5fd11cbb1ee..479d097de9c 100644 --- a/fdbclient/DatabaseConfiguration.cpp +++ b/fdbclient/DatabaseConfiguration.cpp @@ -406,7 +406,9 @@ std::string DatabaseConfiguration::configureStringFromJSON(const StatusObject& j continue; } - result += " "; + if (!result.empty()) { + result += " "; + } // All integers are assumed to be actual DatabaseConfig keys and are set with // the hidden ":=" syntax of the configure command. if (kv.second.type() == json_spirit::int_type) { @@ -449,7 +451,10 @@ std::string DatabaseConfiguration::configureStringFromJSON(const StatusObject& j // explicit log_engine we simply add " log_engine=ssd-2" to the output string if the input JSON did not contain a // log_engine. if (!json.contains("log_engine")) { - result += " log_engine=ssd-2"; + if (!result.empty()) { + result += " "; + } + result += "log_engine=ssd-2"; } return result;