]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Be specfic when detecting "no table" exceptions.
authorJason Kirtland <jek@discorporate.us>
Tue, 17 Jul 2007 13:40:44 +0000 (13:40 +0000)
committerJason Kirtland <jek@discorporate.us>
Tue, 17 Jul 2007 13:40:44 +0000 (13:40 +0000)
lib/sqlalchemy/databases/mysql.py

index d656964b16a100d0e784a5003f9ce7578435730b..31bfa8449d94d4520a71dd874710093b0f5b9dc6 100644 (file)
@@ -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) = \