@@ -121,11 +121,13 @@ struct TKikimrData {
121
121
const TKikimrTableDescription* TKikimrTablesData::EnsureTableExists (const TString& cluster,
122
122
const TString& table, TPositionHandle pos, TExprContext& ctx) const
123
123
{
124
- auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
125
-
126
124
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
+ }
129
131
}
130
132
131
133
auto desc = Tables.FindPtr (std::make_pair (cluster, tablePath));
@@ -141,11 +143,13 @@ const TKikimrTableDescription* TKikimrTablesData::EnsureTableExists(const TStrin
141
143
}
142
144
143
145
TKikimrTableDescription& TKikimrTablesData::GetOrAddTable (const TString& cluster, const TString& database, const TString& table, ETableType tableType) {
144
- auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
145
-
146
146
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
+ }
149
153
}
150
154
151
155
if (!Tables.FindPtr (std::make_pair (cluster, tablePath))) {
@@ -165,11 +169,13 @@ TKikimrTableDescription& TKikimrTablesData::GetOrAddTable(const TString& cluster
165
169
}
166
170
167
171
TKikimrTableDescription& TKikimrTablesData::GetTable (const TString& cluster, const TString& table) {
168
- auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
169
-
170
172
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
+ }
173
179
}
174
180
175
181
auto desc = Tables.FindPtr (std::make_pair (cluster, tablePath));
@@ -181,11 +187,13 @@ TKikimrTableDescription& TKikimrTablesData::GetTable(const TString& cluster, con
181
187
const TKikimrTableDescription& TKikimrTablesData::ExistingTable (const TStringBuf& cluster,
182
188
const TStringBuf& table) const
183
189
{
184
- auto tempTableInfoIt = TempTablesState->FindInfo (table, true );
185
-
186
190
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
+ }
189
197
}
190
198
191
199
auto desc = Tables.FindPtr (std::make_pair (TString (cluster), TString (tablePath)));
0 commit comments