mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Added proper nullptr check
This commit is contained in:
parent
d252c59513
commit
2eb2e4cf41
@ -239,20 +239,25 @@ protected:
|
||||
StoragePtr table = nullptr;
|
||||
TableStructureReadLockHolder lock;
|
||||
|
||||
try
|
||||
if (need_lock_structure)
|
||||
{
|
||||
if (need_lock_structure)
|
||||
table = tables_it->table();
|
||||
if (table == nullptr)
|
||||
{
|
||||
// Table might have just been removed or detached for Lazy engine (see DatabaseLazy::tryGetTable())
|
||||
continue;
|
||||
}
|
||||
try
|
||||
{
|
||||
table = tables_it->table();
|
||||
lock = table->lockStructureForShare(
|
||||
false, context.getCurrentQueryId(), context.getSettingsRef().lock_acquire_timeout);
|
||||
}
|
||||
}
|
||||
catch (const Exception & e)
|
||||
{
|
||||
if (e.code() == ErrorCodes::TABLE_IS_DROPPED)
|
||||
continue;
|
||||
throw;
|
||||
catch (const Exception & e)
|
||||
{
|
||||
if (e.code() == ErrorCodes::TABLE_IS_DROPPED)
|
||||
continue;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
++rows_count;
|
||||
|
Loading…
Reference in New Issue
Block a user