From e9a13940d3f45e7b6696fad396356701a85ccf94 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 9 Jan 2006 01:57:26 +0000 Subject: [PATCH] magic-removal: Merged to [1878] git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1879 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- AUTHORS | 1 + django/db/backends/mysql/base.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 5a9012dffd..49bf7b56dd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -52,6 +52,7 @@ answer newbie questions, and generally made Django that much better: Espen Grindhaug Gustavo Picon Brant Harris + hipertracker@gmail.com Ian Holsman Kieran Holland Robert Rock Howard diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index de3c250e4a..5f76271cdd 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -64,9 +64,12 @@ class DatabaseWrapper: if DATABASE_PORT: kwargs['port'] = DATABASE_PORT self.connection = Database.connect(**kwargs) + cursor = self.connection.cursor() + if self.connection.get_server_info() >= '4.1': + cursor.execute("SET NAMES utf8") if DEBUG: - return util.CursorDebugWrapper(MysqlDebugWrapper(self.connection.cursor()), self) - return self.connection.cursor() + return base.CursorDebugWrapper(MysqlDebugWrapper(cursor), self) + return cursor def commit(self): self.connection.commit()