Fix crashing in case of Replicated database without arguments

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2023-05-21 23:07:03 +02:00
parent 8102fe3e21
commit ef06bb8f14
3 changed files with 5 additions and 1 deletions

View File

@ -227,7 +227,7 @@ BlockIO InterpreterCreateQuery::createDatabase(ASTCreateQuery & create)
metadata_path = metadata_path / "metadata" / database_name_escaped;
}
if (create.storage->engine->name == "Replicated" && !internal && !create.attach)
if (create.storage->engine->name == "Replicated" && !internal && !create.attach && create.storage->engine->arguments)
{
/// Fill in default parameters
if (create.storage->engine->arguments->children.size() == 1)

View File

@ -0,0 +1,4 @@
-- Tags: no-parallel
set allow_experimental_database_replicated=1;
create database replicated_db_no_args engine=Replicated; -- { serverError BAD_ARGUMENTS }