Skip to content

Creating a table with CREATE TABLE <db name>.<table name> (...) fails #70

@nielsreijers

Description

@nielsreijers

When I create a table in MySQL and specify the table name, for example like this

create table test._tmp(id int primary key not null);

the database name is duplicated, which results in incorrect SQL in ClickHouse:

CREATE TABLE test2.test2._tmp
(
    `id` Int32,
    `_version` UInt64,
    INDEX _version _version TYPE minmax GRANULARITY 1,
INDEX idx_id id TYPE bloom_filter GRANULARITY 1
)
ENGINE = ReplacingMergeTree(_version)
PARTITION BY intDiv(id, 4294967)
ORDER BY id
SETTINGS index_granularity = 8192

This is a problem for tools like Percona online schema change, which generates a temporary table using a fully qualified name during migrations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions