Skip to content

Commit 11bcc79

Browse files
Fixed #1121 -- Changed MySQL backend to use correct character set in MySQL 4.1x/5.x on Win32. Thanks, [email protected]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1878 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 9f0deae commit 11bcc79

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ answer newbie questions, and generally made Django that much better:
5252
Espen Grindhaug <http://grindhaug.org/>
5353
Gustavo Picon
5454
Brant Harris
55+
5556
Ian Holsman <http://feh.holsman.net/>
5657
Kieran Holland <http://www.kieranholland.com>
5758
Robert Rock Howard <http://djangomojo.com/>

django/core/db/backends/mysql.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,12 @@ def cursor(self):
6565
if DATABASE_PORT:
6666
kwargs['port'] = DATABASE_PORT
6767
self.connection = Database.connect(**kwargs)
68+
cursor = self.connection.cursor()
69+
if self.connection.get_server_info() >= '4.1':
70+
cursor.execute("SET NAMES utf8")
6871
if DEBUG:
69-
return base.CursorDebugWrapper(MysqlDebugWrapper(self.connection.cursor()), self)
70-
return self.connection.cursor()
72+
return base.CursorDebugWrapper(MysqlDebugWrapper(cursor), self)
73+
return cursor
7174

7275
def commit(self):
7376
self.connection.commit()

0 commit comments

Comments
 (0)