mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Update protobuf to v25.1
The new version deprecates `syntax()` and makes it inaccessible. Instead, the attributes corresponding to a feature should be used. This commit addresses this.
This commit is contained in:
parent
4fd64a696b
commit
11371e886c
2
contrib/google-protobuf
vendored
2
contrib/google-protobuf
vendored
@ -1 +1 @@
|
||||
Subproject commit 0862007f6ca1f5723c58f10f0ca34f3f25a63b2e
|
||||
Subproject commit 0fae801fb4785175a4481aae1c0f721700e7bd99
|
@ -305,12 +305,16 @@ set(libprotoc_files
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/retention.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/ruby/ruby_generator.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/accessors/accessors.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/accessors/singular_bytes.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/accessors/singular_message.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/accessors/singular_scalar.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/accessors/singular_string.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/accessors/unsupported_field.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/context.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/generator.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/message.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/naming.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/oneof.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/rust/relative_path.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/subprocess.cc
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.cc
|
||||
)
|
||||
|
@ -53,7 +53,6 @@ namespace ErrorCodes
|
||||
{
|
||||
extern const int NO_COLUMNS_SERIALIZED_TO_PROTOBUF_FIELDS;
|
||||
extern const int MULTIPLE_COLUMNS_SERIALIZED_TO_SAME_PROTOBUF_FIELD;
|
||||
extern const int NO_COLUMN_SERIALIZED_TO_REQUIRED_PROTOBUF_FIELD;
|
||||
extern const int DATA_TYPE_INCOMPATIBLE_WITH_PROTOBUF_FIELD;
|
||||
extern const int PROTOBUF_FIELD_NOT_REPEATED;
|
||||
extern const int PROTOBUF_BAD_CAST;
|
||||
@ -140,7 +139,7 @@ namespace
|
||||
return false;
|
||||
if (google_wrappers_special_treatment && isGoogleWrapperField(field_descriptor))
|
||||
return false;
|
||||
return field_descriptor.message_type() || (field_descriptor.file()->syntax() == google::protobuf::FileDescriptor::SYNTAX_PROTO3);
|
||||
return field_descriptor.message_type() || !field_descriptor.has_presence();
|
||||
}
|
||||
|
||||
// Should we pack repeated values while storing them.
|
||||
@ -170,7 +169,7 @@ namespace
|
||||
}
|
||||
if (field_descriptor.options().has_packed())
|
||||
return field_descriptor.options().packed();
|
||||
return field_descriptor.file()->syntax() == google::protobuf::FileDescriptor::SYNTAX_PROTO3;
|
||||
return field_descriptor.is_packed();
|
||||
}
|
||||
|
||||
WriteBuffer & writeIndent(WriteBuffer & out, size_t size) { return out << String(size * 4, ' '); }
|
||||
@ -3445,19 +3444,6 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
/// Check that we've found matching columns for all the required fields.
|
||||
if ((message_descriptor.file()->syntax() == google::protobuf::FileDescriptor::SYNTAX_PROTO2)
|
||||
&& reader_or_writer.writer)
|
||||
{
|
||||
for (int i : collections::range(message_descriptor.field_count()))
|
||||
{
|
||||
const auto & field_descriptor = *message_descriptor.field(i);
|
||||
if (field_descriptor.is_required() && !field_descriptors_in_use.count(&field_descriptor))
|
||||
throw Exception(ErrorCodes::NO_COLUMN_SERIALIZED_TO_REQUIRED_PROTOBUF_FIELD, "Field {} is required to be set",
|
||||
quoteString(field_descriptor.full_name()));
|
||||
}
|
||||
}
|
||||
|
||||
if (field_descs.empty())
|
||||
return nullptr;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user