Merge pull request #60689 from azat/system.parts-no-uuid-fix

Fix system.parts for non-Atomic/Ordinary database engine (i.e. Memory)
This commit is contained in:
Alexey Milovidov 2024-03-03 19:55:00 +03:00 committed by GitHub
commit 091f4c3e35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View File

@ -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);

View File

@ -1 +1,2 @@
test all_1_1_0 1
test2 all_1_1_0 1

View File

@ -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();
"