-
Notifications
You must be signed in to change notification settings - Fork 109
Possible error in SHOW CREATE TABLE #594
Comments
This what this python test gives us:
It can be also a bug in sqlalchemy reflection: |
But that bug was fixed... 10 years ago.
…On 18 Jan 2019, 15:59 +0100, Kuba Podgórski ***@***.***>, wrote:
This what this python test gives us:
SHOW VARIABLES LIKE 'sql_mode'
SHOW VARIABLES LIKE 'lower_case_table_names'
SELECT VERSION()
SELECT DATABASE()
SELECT @@transaction_isolation
show collation where `Charset` = 'utf8mb4' and `Collation` = 'utf8mb4_bin'
SELECT CAST('test plain returns' AS CHAR(60)) AS anon_1
SELECT CAST('test unicode returns' AS CHAR(60)) AS anon_1
ROLLBACK
SHOW FULL TABLES FROM `gitbase`
SHOW FULL TABLES FROM `gitbase`
SHOW CREATE TABLE `refs`
ROLLBACK
It can be also a bug in sqlalchemy reflection:
sqlalchemy/sqlalchemy#1117
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I think it was closed in 2008 by some bot but added to the milestone in Nov 2018: |
I dug into sqlalhemy reflection package and I found the first (from many) issue.
what requires a new line after first '('. In other words, instead of one liner we have to return: CREATE TABLE `refs` (
`name` TEXT) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 Another silly parsing issue is in sqlalchemy for line in re.split(r"\r?\n", show_create):
if line.startswith(" " + self.preparer.initial_quote):
self._parse_column(line, state) Condition CREATE TABLE `refs` (
`name` TEXT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
Btw. here is a nice tool to play with: https://regex101.com |
Anyway, I also submitted an new issue for sqlalchemy: |
SQLAlchemy says this:
It's possible we have some kind of error in our
SHOW CREATE TABLE
implementation.Reproduction case:
The text was updated successfully, but these errors were encountered: