Skip to content

Commit 7b3d928

Browse files
pnv1github-actions[bot]
authored andcommitted
Do not move rows type in BulkUpsert if rows were not moved (#26912)
1 parent dad7c61 commit 7b3d928

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

.github/last_commit.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
834977fc44faac0d4668f39ffec80dcbbc74fbaf
1+
78aa6fa75eba124b91b200bfe76c67e94ee968a4

src/client/table/impl/table_client.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,16 +1032,17 @@ TAsyncBulkUpsertResult TTableClient::TImpl::BulkUpsert(const std::string& table,
10321032

10331033
request->set_table(TStringType{table});
10341034

1035-
if (rows.GetType().Impl_.use_count() == 1) {
1036-
request->mutable_rows()->mutable_type()->Swap(&rows.GetType().GetProto());
1037-
} else {
1038-
*request->mutable_rows()->mutable_type() = rows.GetType().GetProto();
1039-
}
1040-
1035+
auto* mutable_rows = request->mutable_rows();
10411036
if (rows.Impl_.use_count() == 1) {
1042-
request->mutable_rows()->mutable_value()->Swap(&rows.GetProto());
1037+
mutable_rows->mutable_value()->Swap(&rows.GetProto());
1038+
if (rows.GetType().Impl_.use_count() == 1) {
1039+
mutable_rows->mutable_type()->Swap(&rows.GetType().GetProto());
1040+
} else {
1041+
*mutable_rows->mutable_type() = rows.GetType().GetProto();
1042+
}
10431043
} else {
1044-
*request->mutable_rows()->mutable_value() = rows.GetProto();
1044+
*mutable_rows->mutable_value() = rows.GetProto();
1045+
*mutable_rows->mutable_type() = rows.GetType().GetProto();
10451046
}
10461047

10471048
auto promise = NewPromise<TBulkUpsertResult>();

0 commit comments

Comments
 (0)