anticipate legacy MySQL version info with strings where integers expected

Issue #4189 new
Nicolas Bur
created an issue

Traceback (most recent call last): print(db.table_names()) File "/home/nbur/.local/lib/python3.5/site-packages/sqlalchemy/engine/", line 2139, in table_names return self.dialect.get_table_names(conn, schema) File "<string>", line 2, in get_table_names File "/home/nbur/.local/lib/python3.5/site-packages/sqlalchemy/engine/", line 42, in cache return fn(self, con, args, *kw) File "/home/nbur/.local/lib/python3.5/site-packages/sqlalchemy/dialects/mysql/", line 1950, in get_table_names if self.server_version_info < (5, 0, 2): TypeError: unorderable types: str() < int()

As written in this log server_version_info doesn't return a tuple of three int adding


line 1950 in File "/home/nbur/.local/lib/python3.5/site-packages/sqlalchemy/dialects/mysql/" displays (5, 0, '51a', '24+lenny5') which clearly can't be compared with (5, 0, 2)…

I mention there is no problem changing and running my script with python 2.7


Comments (6)

  1. Michael Bayer repo owner

    server_version_info() doesn't have a bug here, we need those tokens to be what they are.

    the bug here is that you're oddly enough using exactly a 5.0 version that is for some reason sticking a string into the third token. so this is a very unexpected and buggy version string your DB is reporting which we'd have to work around.

  2. Log in to comment