MySQL reflection breaks with TINYINT(1) with unsigned or zerofill

Issue #1687 resolved
Former user created an issue

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)

  1. Former user 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.

  2. Log in to comment