- attached unsigned_bool_breaks_mysql.patch
MySQL reflection breaks with TINYINT(1) with unsigned or zerofill
Issue #1687
resolved
Since MySQL TINYINT(1) columns are converted to boolean, an unexpected unsigned or zerofill keyword will cause an error during reflection. For example, this code:
from sqlalchemy import *
engine = create_engine('mysql://user:pass@host/db')
meta = MetaData()
meta.reflect(bind=engine)
breaks on this table:
CREATE TABLE `tmp` (
`my_flag` tinyint(1) unsigned zerofill
) ENGINE=InnoDB DEFAULT CHARSET=latin1
The attached patch fixes this by setting those keywords to None when the tinyint(1) column gets converted to a boolean.
Comments (4)
-
Account Deleted -
repo owner somebody beat you to this one in bef9e234de84a1601df4d324feb5c422818a6d3d but thanks !
-
Account Deleted Ah... I was using the Mercurial mirror and it seems that it isn't kept up to date with the svn repository. So I guess I'll switch to using svn instead. Thanks.
-
repo owner - removed milestone
Removing milestone: 0.6.0 (automated comment)
- Log in to comment
Don't use unsigned/zerofill for booleans