Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Default value of text columns cause exception #91

Open
Assignees
Labels
bugSomething isn't working help wantedExtra attention is needed mariadbMariaDB specific
@POPSuL

Description

Describe the bug
Table with that definition cause exception:

CREATE TABLE `test` (
 `test` text NOT NULL DEFAULT '[]'
) ENGINE=InnoDB;

Expected behaviour
Successful table creation

Actual result

mysql2sqlite version 2.3.0 Copyright (c) 2019-2024 Klemen Tusar
2024年11月24日 18:52:15 INFO Transferring table test
2024年11月24日 18:52:16 ERROR SQLite failed creating table test: near "[]": syntax error
Traceback (most recent call last):
 File "/root/.local/bin/mysql2sqlite", line 8, in <module>
 sys.exit(cli())
 ^^^^^
 File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
 return self.main(*args, **kwargs)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/click/core.py", line 1078, in main
 rv = self.invoke(ctx)
 ^^^^^^^^^^^^^^^^
 File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
 return ctx.invoke(self.callback, **ctx.params)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/click/core.py", line 783, in invoke
 return __callback(*args, **kwargs)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/mysql_to_sqlite3/cli.py", line 230, in cli
 converter.transfer()
 File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/mysql_to_sqlite3/transporter.py", line 700, in transfer
 self._create_table(table_name) # type: ignore[arg-type]
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/mysql_to_sqlite3/transporter.py", line 568, in _create_table
 self._sqlite_cur.executescript(self._build_create_table_sql(table_name))
sqlite3.OperationalError: near "[]": syntax error

System Information

$ mysql2sqlite --version
| software | version |
|------------------------|------------------------------------------------------------------------------------------------|
| mysql-to-sqlite3 | 2.3.0 |
| | |
| Operating System | Linux 5.15.153.1-microsoft-standard-WSL2 |
| Python | CPython 3.12.3 |
| MySQL | mysql Ver 15.1 Distrib 10.11.8-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper |
| SQLite | 3.45.1 |
| | |
| click | 8.1.7 |
| mysql-connector-python | 9.1.0 |
| python-slugify | 8.0.4 |
| pytimeparse2 | 1.7.1 |
| simplejson | 3.19.3 |
| tabulate | 0.9.0 |
| tqdm | 4.67.0 |

Metadata

Metadata

Labels

bugSomething isn't working help wantedExtra attention is needed mariadbMariaDB specific

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /