- attached models.py
MySQL ZXJDBC fails on metadata.create_all
Issue #1960
resolved
Bug is in dialects/mysql/base.py#has_table, on exception the orig attr is passed to _extract_error_code (mysql/zxjdbc.py) which expects the exception, not the orig attr, and fails hard. Attaching patch fixed running on Pylons/Pyramid application. This makes using mysql+zxjdbc impossible in current release!
Comments (6)
-
Account Deleted -
Account Deleted - attached mysql_zxjdbc_error.txt
diff of the fix I made to get mysql+zxjdbc working again
-
repo owner - marked as critical
I'm fairly certain this should be the correct patch. Can you please test since I don't have easy access to Jython:
diff -r 4700d344de77513c8ac9825c5a81bc3d5e2bffbd lib/sqlalchemy/dialects/mysql/zxjdbc.py --- a/lib/sqlalchemy/dialects/mysql/zxjdbc.py Mon Nov 01 16:07:47 2010 -0400 +++ b/lib/sqlalchemy/dialects/mysql/zxjdbc.py Wed Nov 03 10:01:55 2010 -0400 @@ -92,7 +92,7 @@ def _extract_error_code(self, exception): # e.g.: DBAPIError: (Error) Table 'test.u2' doesn't exist # [1146](SQLCode:), [42S02](SQLState:) 'DESCRIBE `u2`' () - m = re.compile(r"\[(\d+)\](SQLCode\:)").search(str(exception.orig.args)) + m = re.compile(r"\[(\d+)\](SQLCode\:)").search(str(exception.args)) c = m.group(1) if c: return int(c)
-
Account Deleted Yes, that patch does correctly fix the bug. Thanks for the speedy response!
-
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.6.6 (automated comment)
- Log in to comment
Run this against a mysql database using Jython and current .6 trunk