mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 17:20:50 +00:00
dbms: fixed error with StorageBuffer when destination table doesn't exist [#METR-16352].
This commit is contained in:
parent
0f6bb584fb
commit
2b762c7aa9
@ -164,18 +164,21 @@ public:
|
||||
{
|
||||
destination = storage.context.tryGetTable(storage.destination_database, storage.destination_table);
|
||||
|
||||
if (destination.get() == &storage)
|
||||
throw Exception("Destination table is myself. Write will cause infinite loop.", ErrorCodes::INFINITE_LOOP);
|
||||
if (destination)
|
||||
{
|
||||
if (destination.get() == &storage)
|
||||
throw Exception("Destination table is myself. Write will cause infinite loop.", ErrorCodes::INFINITE_LOOP);
|
||||
|
||||
/// Проверяем структуру таблицы.
|
||||
try
|
||||
{
|
||||
destination->check(block, true);
|
||||
}
|
||||
catch (Exception & e)
|
||||
{
|
||||
e.addMessage("(when looking at destination table " + storage.destination_database + "." + storage.destination_table + ")");
|
||||
throw;
|
||||
/// Проверяем структуру таблицы.
|
||||
try
|
||||
{
|
||||
destination->check(block, true);
|
||||
}
|
||||
catch (Exception & e)
|
||||
{
|
||||
e.addMessage("(when looking at destination table " + storage.destination_database + "." + storage.destination_table + ")");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user