Skip to content

Commit 5d7b204

Browse files
committed
Fix use-after-move
commit_hash:deecd542641807d9f8e1414dc1658d159bb0f963
1 parent 8981ad8 commit 5d7b204

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

yt/yql/providers/yt/gateway/native/yql_yt_native.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,13 +1710,17 @@ class TYtNativeGateway : public IYtGateway {
17101710
TGetTablePartitionsResult GetTablePartitions(TGetTablePartitionsOptions&& options) override {
17111711
try {
17121712
TSession::TPtr session = GetSession(options.SessionId());
1713+
const TString cluster = options.Cluster();
1714+
const TString tmpFolder = GetTablesTmpFolder(*options.Config(), cluster);
17131715

1714-
auto execCtx = MakeExecCtx(std::move(options), session, options.Cluster(), nullptr, nullptr);
1716+
auto execCtx = MakeExecCtx(std::move(options), session, cluster, nullptr, nullptr);
17151717
auto entry = execCtx->GetOrCreateEntry();
17161718

17171719
TVector<NYT::TRichYPath> paths;
17181720
for (const auto& pathInfo: execCtx->Options_.Paths()) {
1719-
const TString tmpFolder = GetTablesTmpFolder(*options.Config(), pathInfo->Table->Cluster);
1721+
YQL_ENSURE(pathInfo->Table->Cluster == cluster,
1722+
"Remote tables are not supported in GetTablePartitions(): requested cluster " << pathInfo->Table->Cluster.Quote() <<
1723+
", runtime cluster: " << cluster.Quote());
17201724
const auto tablePath = TransformPath(tmpFolder, pathInfo->Table->Name, pathInfo->Table->IsTemp, session->UserName_);
17211725
NYT::TRichYPath richYtPath{NYT::AddPathPrefix(tablePath, NYT::TConfig::Get()->Prefix)};
17221726
if (!pathInfo->Table->IsTemp || pathInfo->Table->IsAnonymous) {

0 commit comments

Comments
 (0)