Skip to content

current database is not propagated with on_cluster in AS clause #39500

@den-crane

Description

@den-crane
create database test on cluster c1;
use test;
create table test on cluster c1 (A Int64) Engine=Log;

create  table d on cluster c1 as test Engine=Distributed('c1', currentDatabase(), test);
Code: 60. DB::Exception: Table dw.test doesn't exist. (UNKNOWN_TABLE) (version 22.6.3.35 (official build))

create  table d on cluster c1 as test.test Engine=Distributed('c1', currentDatabase(), test);
OK

it fails because as test is looked in a default database (dw is default in my case).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions