diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-10-01 16:35:45 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-10-01 16:35:45 +0000 |
commit | d7d5eccd3f042830998bfec3642798eff0e9d7c0 (patch) | |
tree | 4c7e2e3ec03caef93219cb2ac92c5d132e646893 /lib/sqlalchemy/databases/mysql.py | |
parent | 8a1706b494e5e164ea584dc4a573fa0873482dc7 (diff) | |
download | sqlalchemy-d7d5eccd3f042830998bfec3642798eff0e9d7c0.tar.gz |
[ticket:318] has a user receiving back a unicode from a SHOW CREATE TABLE for some reason
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index f833489d2..0685397d7 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -377,7 +377,9 @@ class MySQLDialect(ansisql.ANSIDialect): """ c = connection.execute("SHOW CREATE TABLE " + table.name, {}) desc_fetched = c.fetchone()[1] - if type(desc_fetched) is not str: + if type(desc_fetched) is unicode: + desc_fetched = str(desc_fetched) + elif type(desc_fetched) is not str: # may get array.array object here, depending on version (such as mysql 4.1.14 vs. 4.1.11) desc_fetched = desc_fetched.tostring() desc = desc_fetched.strip() |