diff --git a/src/Storages/System/StorageSystemPartsBase.cpp b/src/Storages/System/StorageSystemPartsBase.cpp index 48dab8c4777e..3babdd5c7c12 100644 --- a/src/Storages/System/StorageSystemPartsBase.cpp +++ b/src/Storages/System/StorageSystemPartsBase.cpp @@ -138,7 +138,7 @@ StoragesInfoStream::StoragesInfoStream(const SelectQueryInfo & query_info, Conte String engine_name = storage->getName(); UUID storage_uuid = storage->getStorageID().uuid; - if (database->getEngineName() == "Ordinary") + if (storage_uuid == UUIDHelpers::Nil) { SipHash hash; hash.update(database_name); diff --git a/tests/queries/0_stateless/02956_clickhouse_local_system_parts.reference b/tests/queries/0_stateless/02956_clickhouse_local_system_parts.reference index 30365d839303..b33c7b902459 100644 --- a/tests/queries/0_stateless/02956_clickhouse_local_system_parts.reference +++ b/tests/queries/0_stateless/02956_clickhouse_local_system_parts.reference @@ -1 +1,2 @@ test all_1_1_0 1 +test2 all_1_1_0 1 diff --git a/tests/queries/0_stateless/02956_clickhouse_local_system_parts.sh b/tests/queries/0_stateless/02956_clickhouse_local_system_parts.sh index e9d8eb081fb7..dac0cc2b865d 100755 --- a/tests/queries/0_stateless/02956_clickhouse_local_system_parts.sh +++ b/tests/queries/0_stateless/02956_clickhouse_local_system_parts.sh @@ -5,4 +5,12 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # shellcheck source=../shell_config.sh . "$CUR_DIR"/../shell_config.sh -$CLICKHOUSE_LOCAL --multiquery "CREATE TABLE test (x UInt8) ENGINE = MergeTree ORDER BY (); INSERT INTO test SELECT 1; SELECT table, name, rows FROM system.parts WHERE database = currentDatabase();" +$CLICKHOUSE_LOCAL --multiquery " + CREATE TABLE test (x UInt8) ENGINE = MergeTree ORDER BY (); + INSERT INTO test SELECT 1; + + CREATE TABLE test2 (x UInt8) ENGINE = MergeTree ORDER BY (); + INSERT INTO test2 SELECT 1; + + SELECT table, name, rows FROM system.parts WHERE database = currentDatabase(); +"