diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-02 18:16:17 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-02 18:21:09 -0500 |
| commit | 2ac2bbd3508843a200b6245225bef3bc4631fb41 (patch) | |
| tree | 38c5b1cf5e688472fda50103361ad1694ed87787 | |
| parent | 5f144b2e435408a555b49ce0b8953af3499c03ab (diff) | |
| download | sqlalchemy-2ac2bbd3508843a200b6245225bef3bc4631fb41.tar.gz | |
- add a few missing methods to the cymysql dialect
| -rw-r--r-- | doc/build/changelog/changelog_08.rst | 9 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/cymysql.py | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/doc/build/changelog/changelog_08.rst b/doc/build/changelog/changelog_08.rst index 1885ddf37..85d702685 100644 --- a/doc/build/changelog/changelog_08.rst +++ b/doc/build/changelog/changelog_08.rst @@ -12,6 +12,15 @@ :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 0806f63b4..18b6eb800 100644 --- a/lib/sqlalchemy/dialects/mysql/cymysql.py +++ b/lib/sqlalchemy/dialects/mysql/cymysql.py @@ -56,6 +56,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 |
