| 432 | } |
| 433 | |
| 434 | arrow::Result<Result> PackActionResult(const google::protobuf::Message& message) { |
| 435 | google::protobuf::Any any; |
| 436 | #if PROTOBUF_VERSION >= 3015000 |
| 437 | if (!any.PackFrom(message)) { |
| 438 | return Status::IOError("Failed to pack ", message.GetTypeName()); |
| 439 | } |
| 440 | #else |
| 441 | any.PackFrom(message); |
| 442 | #endif |
| 443 | |
| 444 | std::string buffer; |
| 445 | #if PROTOBUF_VERSION >= 3015000 |
| 446 | if (!any.SerializeToString(&buffer)) { |
| 447 | return Status::IOError("Failed to serialize packed ", message.GetTypeName()); |
| 448 | } |
| 449 | #else |
| 450 | any.SerializeToString(&buffer); |
| 451 | #endif |
| 452 | return Result{Buffer::FromString(std::move(buffer))}; |
| 453 | } |
| 454 | |
| 455 | arrow::Result<Result> PackActionResult(ActionBeginSavepointResult result) { |
| 456 | pb::sql::ActionBeginSavepointResult pb_result; |
no test coverage detected