techouse / sqlite3-to-mysql

Transfer data from SQLite to MySQL

Home Page:https://techouse.github.io/sqlite3-to-mysql/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conversion failure with table name over 64 characters

andrewguertin opened this issue · comments

Describe the bug
MariaDB/MySQL have a table name length limit of 64 characters. Sqlite doesn't. When importing an sqlite database with table names longer than 64 characters, there is an error and the conversion fails.

Expected behaviour
Conversion works

Actual result
MySQL failed creating table myverylongtablename012345678901234567890123456789012345678901234567890: 1103 (42000): Incorrect table name 'myverylongtablename012345678901234567890123456789012345678901234567890'

System Information

$ sqlite3mysql --version
| software               | version                                                                        |
|------------------------|--------------------------------------------------------------------------------|
| sqlite3-to-mysql       | 1.4.5                                                                          |
|                        |                                                                                |
| Operating System       | Linux 5.14.2                                                                   |
| Python                 | CPython 3.9.6                                                                  |
| MySQL                  | mysql  Ver 15.1 Distrib 10.5.10-MariaDB, for Linux (x86_64) using readline 8.1 |
| SQLite                 | 3.35.5                                                                         |
|                        |                                                                                |
| click                  | 8.0.1                                                                          |
| mysql-connector-python | 8.0.26                                                                         |
| pytimeparse            | 1.1.8                                                                          |
| simplejson             | 3.17.3                                                                         |
| six                    | 1.16.0                                                                         |
| tabulate               | 0.8.9                                                                          |
| tqdm                   | 4.62.0                                                                         |

Additional context
Documentation links:
https://mariadb.com/kb/en/identifier-names/
https://dev.mysql.com/doc/refman/8.0/en/identifier-length.html
(I couldn't find any documentation verifying limits (or that there are none) for sqlite, but I have existing files with table names up to 70 characters.)

That's another edge case.

If you have the time, please submit a PR with the appropriate unit tests, otherwise, I'll pick it up once I have time.