Skip to content

Commit

Permalink
Fixed django#1121 -- Changed MySQL backend to use correct character s…
Browse files Browse the repository at this point in the history
…et 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
  • Loading branch information
adrianholovaty committed Jan 9, 2006
1 parent 9f0deae commit 11bcc79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -52,6 +52,7 @@ answer newbie questions, and generally made Django that much better:
Espen Grindhaug <http://grindhaug.org/>
Gustavo Picon
Brant Harris
hipertracker@gmail.com
Ian Holsman <http://feh.holsman.net/>
Kieran Holland <http://www.kieranholland.com>
Robert Rock Howard <http://djangomojo.com/>
Expand Down
7 changes: 5 additions & 2 deletions django/core/db/backends/mysql.py
Expand Up @@ -65,9 +65,12 @@ def cursor(self):
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()
Expand Down

0 comments on commit 11bcc79

Please sign in to comment.