aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Nechitaev <nechda6@gmail.com>2024-08-29 14:43:41 +0300
committerGitHub <noreply@github.com>2024-08-29 14:43:41 +0300
commit1e1d882ec03da28b2b1ad627b31bf121a8f5758f (patch)
treeed7464d2e0ca30208c06ec0ae7f90fc3364627e9
parentacc98449bb246ee1fcad1cbe3121ceced0df3baa (diff)
downloadydb-1e1d882ec03da28b2b1ad627b31bf121a8f5758f.tar.gz
Prepare cpp-protobuf migration (#8443)
Co-authored-by: Dmitry Nechitaev <nechda@yandex-team.ru>
-rw-r--r--ydb/library/yql/parser/proto_ast/gen/multiproto.py2
-rw-r--r--ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/ydb/library/yql/parser/proto_ast/gen/multiproto.py b/ydb/library/yql/parser/proto_ast/gen/multiproto.py
index de5b8bf76b..78019518f0 100644
--- a/ydb/library/yql/parser/proto_ast/gen/multiproto.py
+++ b/ydb/library/yql/parser/proto_ast/gen/multiproto.py
@@ -73,7 +73,7 @@ def main(argv):
if type_name in current_types:
out_file.write(line)
continue
- if line.startswith("static ") or (line.startswith("const ") and ("[]" in line or "=" in line)) or line.startswith("PROTOBUF_ATTRIBUTE_WEAK"):
+ if line.startswith("static ") or (line.startswith("const ") and ("[]" in line or "=" in line)) or line.startswith("PROTOBUF_ATTRIBUTE_WEAK") or line.startswith("PROTOBUF_ATTRIBUTE_INIT_PRIORITY2"):
is_data_stmt = True
extern_data = "file_level_metadata" in line or ("descriptor_table" in line and "once" in line)
extern_code = line.startswith("PROTOBUF_ATTRIBUTE_WEAK")
diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
index 45b0fb76c0..893fc9eecb 100644
--- a/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
+++ b/ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp
@@ -5,6 +5,7 @@
#include <ydb/public/lib/ydb_cli/common/print_utils.h>
#include <ydb/public/lib/ydb_cli/common/scheme_printers.h>
#include <ydb/public/sdk/cpp/client/ydb_proto/accessor.h>
+#include <google/protobuf/port_def.inc>
#include <util/string/join.h>
@@ -303,7 +304,11 @@ static int PrintProtoJsonBase64(const T& msg) {
const auto status = MessageToJsonString(msg, &json, opts);
if (!status.ok()) {
+ #if PROTOBUF_VERSION >= 4022005
+ Cerr << "Error occurred while converting proto to json: " << status.message() << Endl;
+ #else
Cerr << "Error occurred while converting proto to json: " << status.message().ToString() << Endl;
+ #endif
return EXIT_FAILURE;
}