Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mysql_ch_replicator/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,15 @@ def parse_mysql_table_structure(self, create_statement, required_table_name=None
if structure.charset:
structure.charset_python = CHARSET_MYSQL_TO_PYTHON[structure.charset]

prev_line = ''
for line in inner_tokens:
line = prev_line + line
q_count = line.count('`')
if q_count % 2 == 1:
prev_line = line
continue
prev_line = ''

if line.lower().startswith('unique key'):
continue
if line.lower().startswith('key'):
Expand Down
3 changes: 2 additions & 1 deletion test_mysql_ch_replicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,8 @@ def test_different_types_1():
`modified_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`entity` int NOT NULL DEFAULT '0',
`sent_2_tac` char(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '0',
PRIMARY KEY (id)
PRIMARY KEY (id),
KEY `name, employee` (`name`,`employee`) USING BTREE
);
''')

Expand Down
Loading