From c3c79b997b4550c1696aa21ffbbe560c30262677 Mon Sep 17 00:00:00 2001 From: Jason Kirtland Date: Wed, 5 Sep 2007 19:39:07 +0000 Subject: Fixed reflection of the empty string for mysql enums. --- lib/sqlalchemy/databases/mysql.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 6d5c54578..507876481 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -1106,7 +1106,7 @@ class MSEnum(MSString): self.enums = strip_enums self.strict = kw.pop('strict', False) - length = max([len(v) for v in strip_enums]) + length = max([len(v) for v in strip_enums] + [0]) super(MSEnum, self).__init__(length, **kw) def bind_processor(self, dialect): @@ -2175,7 +2175,7 @@ class MySQLSchemaReflector(object): r'(?:\((\d+)\))?(?=\,|$))+' % quotes) # 'foo' or 'foo','bar' or 'fo,o','ba''a''r' - self._re_csv_str = _re_compile(r'\x27(?:\x27\x27|[^\x27])+\x27') + self._re_csv_str = _re_compile(r'\x27(?:\x27\x27|[^\x27])*\x27') # 123 or 123,456 self._re_csv_int = _re_compile(r'\d+') @@ -2192,7 +2192,7 @@ class MySQLSchemaReflector(object): r'%(iq)s(?P(?:%(esc_fq)s|[^%(fq)s])+)%(fq)s +' r'(?P\w+)' r'(?:\((?P(?:\d+|\d+,\d+|' - r'(?:\x27(?:\x27\x27|[^\x27])+\x27,?)+))\))?' + r'(?:\x27(?:\x27\x27|[^\x27])*\x27,?)+))\))?' r'(?: +(?PUNSIGNED))?' r'(?: +(?PZEROFILL))?' r'(?: +CHARACTER SET +(?P\w+))?' -- cgit v1.2.1