diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-01-09 01:55:37 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-01-09 01:55:37 +0000 |
| commit | 11bcc7969d43db596cbbad51db220d1f264fbac3 (patch) | |
| tree | 6b0c4ff7c815f5b6abecfdb305c1cfab2b10ae3e /django | |
| parent | 9f0deae2494f9e5e5d7a55b7fa46ef53c1ca34d7 (diff) | |
Fixed #1121 -- Changed MySQL backend to use correct character set in MySQL 4.1x/5.x on Win32. Thanks, hipertracker@gmail.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1878 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/db/backends/mysql.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/django/core/db/backends/mysql.py b/django/core/db/backends/mysql.py index 629ea8d71f..84fe416f64 100644 --- a/django/core/db/backends/mysql.py +++ b/django/core/db/backends/mysql.py @@ -65,9 +65,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 base.CursorDebugWrapper(MysqlDebugWrapper(self.connection.cursor()), self) - return self.connection.cursor() + return base.CursorDebugWrapper(MysqlDebugWrapper(cursor), self) + return cursor def commit(self): self.connection.commit() |
