Skip to content

Commit 526bd01

Browse files
committed
Fixes
1 parent f97111f commit 526bd01

File tree

3 files changed

+30
-20
lines changed

3 files changed

+30
-20
lines changed

ydb/core/kqp/provider/yql_kikimr_provider.cpp

+24-16
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,13 @@ struct TKikimrData {
121121
const TKikimrTableDescription* TKikimrTablesData::EnsureTableExists(const TString& cluster,
122122
const TString& table, TPositionHandle pos, TExprContext& ctx) const
123123
{
124-
auto tempTableInfoIt = TempTablesState->FindInfo(table, true);
125-
126124
auto tablePath = table;
127-
if (tempTableInfoIt != TempTablesState->TempTables.end()) {
128-
tablePath = tempTableInfoIt->first;
125+
if (TempTablesState) {
126+
auto tempTableInfoIt = TempTablesState->FindInfo(table, true);
127+
128+
if (tempTableInfoIt != TempTablesState->TempTables.end()) {
129+
tablePath = tempTableInfoIt->first;
130+
}
129131
}
130132

131133
auto desc = Tables.FindPtr(std::make_pair(cluster, tablePath));
@@ -141,11 +143,13 @@ const TKikimrTableDescription* TKikimrTablesData::EnsureTableExists(const TStrin
141143
}
142144

143145
TKikimrTableDescription& TKikimrTablesData::GetOrAddTable(const TString& cluster, const TString& database, const TString& table, ETableType tableType) {
144-
auto tempTableInfoIt = TempTablesState->FindInfo(table, true);
145-
146146
auto tablePath = table;
147-
if (tempTableInfoIt != TempTablesState->TempTables.end()) {
148-
tablePath = tempTableInfoIt->first;
147+
if (TempTablesState) {
148+
auto tempTableInfoIt = TempTablesState->FindInfo(table, true);
149+
150+
if (tempTableInfoIt != TempTablesState->TempTables.end()) {
151+
tablePath = tempTableInfoIt->first;
152+
}
149153
}
150154

151155
if (!Tables.FindPtr(std::make_pair(cluster, tablePath))) {
@@ -165,11 +169,13 @@ TKikimrTableDescription& TKikimrTablesData::GetOrAddTable(const TString& cluster
165169
}
166170

167171
TKikimrTableDescription& TKikimrTablesData::GetTable(const TString& cluster, const TString& table) {
168-
auto tempTableInfoIt = TempTablesState->FindInfo(table, true);
169-
170172
auto tablePath = table;
171-
if (tempTableInfoIt != TempTablesState->TempTables.end()) {
172-
tablePath = tempTableInfoIt->first;
173+
if (TempTablesState) {
174+
auto tempTableInfoIt = TempTablesState->FindInfo(table, true);
175+
176+
if (tempTableInfoIt != TempTablesState->TempTables.end()) {
177+
tablePath = tempTableInfoIt->first;
178+
}
173179
}
174180

175181
auto desc = Tables.FindPtr(std::make_pair(cluster, tablePath));
@@ -181,11 +187,13 @@ TKikimrTableDescription& TKikimrTablesData::GetTable(const TString& cluster, con
181187
const TKikimrTableDescription& TKikimrTablesData::ExistingTable(const TStringBuf& cluster,
182188
const TStringBuf& table) const
183189
{
184-
auto tempTableInfoIt = TempTablesState->FindInfo(table, true);
185-
186190
auto tablePath = table;
187-
if (tempTableInfoIt != TempTablesState->TempTables.end()) {
188-
tablePath = tempTableInfoIt->first;
191+
if (TempTablesState) {
192+
auto tempTableInfoIt = TempTablesState->FindInfo(table, true);
193+
194+
if (tempTableInfoIt != TempTablesState->TempTables.end()) {
195+
tablePath = tempTableInfoIt->first;
196+
}
189197
}
190198

191199
auto desc = Tables.FindPtr(std::make_pair(TString(cluster), TString(tablePath)));

ydb/core/kqp/provider/yql_kikimr_provider.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,12 @@ class TKikimrTransactionContextBase : public TThrRefBase {
319319
auto newOp = TYdbOperation(op.GetOperation());
320320
TPosition pos(op.GetPosition().GetColumn(), op.GetPosition().GetRow());
321321

322-
auto tempTableInfoIt = TempTablesState->FindInfo(table, false);
322+
if (TempTablesState) {
323+
auto tempTableInfoIt = TempTablesState->FindInfo(table, false);
323324

324-
if (tempTableInfoIt != TempTablesState->TempTables.end()) {
325-
table = tempTableInfoIt->first + TempTablesState->SessionId;
325+
if (tempTableInfoIt != TempTablesState->TempTables.end()) {
326+
table = tempTableInfoIt->first + TempTablesState->SessionId;
327+
}
326328
}
327329

328330
const auto info = tableInfoMap.FindPtr(table);

ydb/core/kqp/session_actor/kqp_session_actor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ class TKqpSessionActor : public TActorBootstrapped<TKqpSessionActor> {
11801180
return {{true, {JoinPath({path.first, path.second}), {path.second, path.first, userToken}}}};
11811181
}
11821182

1183-
auto it = TempTablesState.FindInfo(JoinPath({path.first, path.second}));
1183+
auto it = TempTablesState.FindInfo(JoinPath({path.first, path.second}), true);
11841184
if (it == TempTablesState.TempTables.end()) {
11851185
return std::nullopt;
11861186
}

0 commit comments

Comments
 (0)