mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
clickhouse-local: fix CREATE DATABASE with Atomic engine
Before it fails to create due to "metadata" directory had not been created, since metadata_path is different for Atomic database, see InterpreterCreateQuery.cpp.
This commit is contained in:
parent
4cc45c1e15
commit
5fad4f6204
@ -43,6 +43,7 @@ DatabaseAtomic::DatabaseAtomic(String name_, String metadata_path_, UUID uuid, c
|
||||
, db_uuid(uuid)
|
||||
{
|
||||
assert(db_uuid != UUIDHelpers::Nil);
|
||||
fs::create_directories(fs::path(getContext()->getPath()) / "metadata");
|
||||
fs::create_directories(path_to_table_symlinks);
|
||||
tryCreateMetadataSymlink();
|
||||
}
|
||||
|
12
tests/queries/0_stateless/02135_local_create_db.sh
Executable file
12
tests/queries/0_stateless/02135_local_create_db.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
for Engine in Atomic Ordinary; do
|
||||
$CLICKHOUSE_LOCAL --query """
|
||||
CREATE DATABASE foo_$Engine Engine=$Engine;
|
||||
DROP DATABASE foo_$Engine;
|
||||
"""
|
||||
done
|
Loading…
Reference in New Issue
Block a user