mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Do not try to resolve temporary tables from global context
This commit is contained in:
parent
69cd19a342
commit
fa317e96e8
@ -2821,6 +2821,10 @@ StorageID Context::resolveStorageIDImpl(StorageID storage_id, StorageNamespace w
|
||||
}
|
||||
|
||||
bool look_for_external_table = where & StorageNamespace::ResolveExternal;
|
||||
/// Global context should not contain temporary tables
|
||||
if (isGlobalContext() && getApplicationType() != ApplicationType::LOCAL)
|
||||
look_for_external_table = false;
|
||||
|
||||
bool in_current_database = where & StorageNamespace::ResolveCurrentDatabase;
|
||||
bool in_specified_database = where & StorageNamespace::ResolveGlobal;
|
||||
|
||||
@ -2838,9 +2842,6 @@ StorageID Context::resolveStorageIDImpl(StorageID storage_id, StorageNamespace w
|
||||
|
||||
if (look_for_external_table)
|
||||
{
|
||||
/// Global context should not contain temporary tables
|
||||
assert(!isGlobalContext() || getApplicationType() == ApplicationType::LOCAL);
|
||||
|
||||
auto resolved_id = StorageID::createEmpty();
|
||||
auto try_resolve = [&](ContextPtr context) -> bool
|
||||
{
|
||||
|
@ -0,0 +1,5 @@
|
||||
-- { echo }
|
||||
SELECT * FROM remote('127.1', system.one, 1 IN id); -- { serverError UNKNOWN_TABLE }
|
||||
SELECT * FROM remote('127.1', system.one, 1 IN dummy); -- { serverError UNKNOWN_TABLE }
|
||||
SELECT * FROM remote('127.1', view(SELECT * FROM system.one), 1 IN id); -- { serverError UNKNOWN_TABLE }
|
||||
SELECT * FROM remote('127.1', view(SELECT number AS id FROM numbers(2)), 1 IN id); -- { serverError UNKNOWN_TABLE }
|
@ -0,0 +1,5 @@
|
||||
-- { echo }
|
||||
SELECT * FROM remote('127.1', system.one, 1 IN id); -- { serverError UNKNOWN_TABLE }
|
||||
SELECT * FROM remote('127.1', system.one, 1 IN dummy); -- { serverError UNKNOWN_TABLE }
|
||||
SELECT * FROM remote('127.1', view(SELECT * FROM system.one), 1 IN id); -- { serverError UNKNOWN_TABLE }
|
||||
SELECT * FROM remote('127.1', view(SELECT number AS id FROM numbers(2)), 1 IN id); -- { serverError UNKNOWN_TABLE }
|
Loading…
Reference in New Issue
Block a user