summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/mysql.py
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2007-07-17 13:40:44 +0000
committerJason Kirtland <jek@discorporate.us>2007-07-17 13:40:44 +0000
commit378bf5b2fce6330d255608115b2f1c208052eaa1 (patch)
tree8b3672cd934aaf3a3c5ec839245a964c170ed04e /lib/sqlalchemy/databases/mysql.py
parent23d01887491c646e321f6bb1e8427b3dd82581c1 (diff)
downloadsqlalchemy-378bf5b2fce6330d255608115b2f1c208052eaa1.tar.gz
Be specfic when detecting "no table" exceptions.
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r--lib/sqlalchemy/databases/mysql.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py
index d656964b1..31bfa8449 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) = \