Skip to content

Table not created if current database not selected #115

@jun-ke

Description

@jun-ke

When current database is not set in MySQL connection

mysql> SELECT DATABASE();
+------------+
| DATABASE() |
+------------+
| NULL       |
+------------+

and trying to create table like:

CREATE TABLE dbname.table_name (id int primary key not null);

it creates table in MySQL but not in ClickHouse, and when rows added in newly created table it causes error

File "db_replicator.py", line 453, in handle_insert_event
    mysql_table_structure = self.state.tables_structure[event.table_name][0]
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'table_name'

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