Commits

jason kirtland  committed 512fc81

Be specfic when detecting "no table" exceptions.

  • Participants
  • Parent commits 6809485

Comments (0)

Files changed (1)

File lib/sqlalchemy/databases/mysql.py

             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) = \