Skip to content

Commit

Permalink
Merge pull request #60689 from azat/system.parts-no-uuid-fix
Browse files Browse the repository at this point in the history
Fix system.parts for non-Atomic/Ordinary database engine (i.e. Memory)
  • Loading branch information
alexey-milovidov committed Mar 3, 2024
2 parents c427575 + 707200d commit 091f4c3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Storages/System/StorageSystemPartsBase.cpp
Expand Up @@ -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);
Expand Down
@@ -1 +1,2 @@
test all_1_1_0 1
test2 all_1_1_0 1
Expand Up @@ -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();
"

0 comments on commit 091f4c3

Please sign in to comment.