From: Mike Bayer Date: Sun, 2 Feb 2014 23:16:17 +0000 (-0500) Subject: - add a few missing methods to the cymysql dialect X-Git-Tag: rel_0_9_2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1b8a495767866f975a12e516dee98eaf7f2269c0;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - add a few missing methods to the cymysql dialect --- diff --git a/doc/build/changelog/changelog_08.rst b/doc/build/changelog/changelog_08.rst index 984ee4c646..c159089e2a 100644 --- a/doc/build/changelog/changelog_08.rst +++ b/doc/build/changelog/changelog_08.rst @@ -11,6 +11,15 @@ .. changelog:: :version: 0.8.5 + .. change:: + :tags: bug, mysql + :pullreq: github:61 + :versions: 0.9.2 + + Some missing methods added to the cymysql dialect, including + _get_server_version_info() and _detect_charset(). Pullreq + courtesy Hajime Nakagami. + .. change:: :tags: bug, py3k :pullreq: github:63 diff --git a/lib/sqlalchemy/dialects/mysql/cymysql.py b/lib/sqlalchemy/dialects/mysql/cymysql.py index e81a79b85c..40bbc880ed 100644 --- a/lib/sqlalchemy/dialects/mysql/cymysql.py +++ b/lib/sqlalchemy/dialects/mysql/cymysql.py @@ -52,6 +52,14 @@ class MySQLDialect_cymysql(MySQLDialect_mysqldb): def dbapi(cls): return __import__('cymysql') + def _get_server_version_info(self, connection): + dbapi_con = connection.connection + version = [int(v) for v in dbapi_con.server_version.split('.')] + return tuple(version) + + def _detect_charset(self, connection): + return connection.connection.charset + def _extract_error_code(self, exception): return exception.errno