]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
further str() on values that may come back as unicode
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 1 Oct 2006 16:41:49 +0000 (16:41 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 1 Oct 2006 16:41:49 +0000 (16:41 +0000)
lib/sqlalchemy/databases/mysql.py

index 0685397d738cd4180a87c4238688a13da7bfcc8b..ff2007928ea35d8a2ceb64a6e3c18562d2e3238a 100644 (file)
@@ -327,7 +327,9 @@ class MySQLDialect(ansisql.ANSIDialect):
             if not found_table:
                 found_table = True
 
-            (name, type, nullable, primary_key, default) = (row[0], row[1], row[2] == 'YES', row[3] == 'PRI', row[4])
+            # there is a configuration in ticket:318 where everything is coming back as unicode,
+            # not sure of the reason as of yet
+            (name, type, nullable, primary_key, default) = (str(row[0]), str(row[1]), row[2] == 'YES', row[3] == 'PRI', row[4])
             
             match = re.match(r'(\w+)(\(.*?\))?\s*(\w+)?\s*(\w+)?', type)
             col_type = match.group(1)