From 855dbda8258ef62444286924431a5a8171b91e89 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 3 Nov 2010 15:45:21 -0400 Subject: [PATCH] - mysql - Fixed error handling for Jython + zxjdbc, such that has_table() property works again. Regression from 0.6.3 (we don't have a Jython buildbot, sorry) [ticket:1960] --- CHANGES | 6 ++++++ lib/sqlalchemy/dialects/mysql/zxjdbc.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 3ccf2d28eb..452e484a10 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,12 @@ CHANGES object to be garbage collected, losing track of any changes that weren't previously saved in the "mutable changes" dictionary. + +- mysql + - Fixed error handling for Jython + zxjdbc, such that + has_table() property works again. Regression from + 0.6.3 (we don't have a Jython buildbot, sorry) + [ticket:1960] 0.6.5 ===== diff --git a/lib/sqlalchemy/dialects/mysql/zxjdbc.py b/lib/sqlalchemy/dialects/mysql/zxjdbc.py index 06d3e66160..0c0c39b673 100644 --- a/lib/sqlalchemy/dialects/mysql/zxjdbc.py +++ b/lib/sqlalchemy/dialects/mysql/zxjdbc.py @@ -92,7 +92,7 @@ class MySQLDialect_zxjdbc(ZxJDBCConnector, MySQLDialect): def _extract_error_code(self, exception): # e.g.: DBAPIError: (Error) Table 'test.u2' doesn't exist # [SQLCode: 1146], [SQLState: 42S02] 'DESCRIBE `u2`' () - m = re.compile(r"\[SQLCode\: (\d+)\]").search(str(exception.orig.args)) + m = re.compile(r"\[SQLCode\: (\d+)\]").search(str(exception.args)) c = m.group(1) if c: return int(c) -- 2.47.2