From: Jason Kirtland Date: Tue, 17 Jul 2007 13:40:44 +0000 (+0000) Subject: Be specfic when detecting "no table" exceptions. X-Git-Tag: rel_0_3_10~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=378bf5b2fce6330d255608115b2f1c208052eaa1;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Be specfic when detecting "no table" exceptions. --- diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index d656964b16..31bfa8449d 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -1093,10 +1093,11 @@ class MySQLDialect(ansisql.ANSIDialect): table.metadata.tables[table.name]= table try: - rp = connection.execute("describe " + self._escape_table_name(table), - {}) - except: - raise exceptions.NoSuchTableError(table.fullname) + rp = connection.execute("DESCRIBE " + self._escape_table_name(table)) + except exceptions.SQLError, e: + if e.orig.args[0] == 1146: + raise exceptions.NoSuchTableError(table.fullname) + raise for row in _compat_fetch(rp, charset=decode_from): (name, type, nullable, primary_key, default) = \