Thanks for the quick changes there! On Jan 4, 7:45 pm, "Michael Bayer" <mike...@zzzcomputing.com> wrote: .. > For MySQL dialects there should be no errors or failures - at most there > may be a handful of errors/failures which correspond to tests that should > be skipped for that DBAPI, although if you're getting one of those which > leads the database into an invalid state it may result in a cascade of > many failures.
OK, so I guess we got still a long way to go. :) I ran tests with MySQLdb but ran in lots of failures, but I'm concentrating on MySQL Connector/Python for now. One thing I can't figure out is why tests are not cleaning up or dropping tables. Works apparently good with MySQLdb, but not with our Connector. Something for tomorrow on the train. > It's more likely that the mysqlconnector dialect has some outdated > elements in it which need to be updated, or perhaps that there's some > DBAPI behavior not yet provided by mysqlconnector that SQLA is expecting. > A log of tests running with MySQLdb as well as OurSQL is > athttp://paste.pocoo.org/show/161970/ Ah, attached another small patch, no need to parse, if you got the errno right from the exception :) -Geert =================================================================== --- lib/sqlalchemy/dialects/mysql/mysqlconnector.py (revision 6615) +++ lib/sqlalchemy/dialects/mysql/mysqlconnector.py (working copy) @@ -66,11 +66,10 @@ return connection.connection.get_characterset_info() def _extract_error_code(self, exception): - m = re.compile(r"\(.*\)\s+(\d+)").search(str(exception)) - c = m.group(1) - if c: - return int(c) - else: + try: + if exception.errno > -1: + return int(exception.errno) + except: return None -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.