Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #3151 -- Improved MySQL backend not to send 'SET NAMES utf8' be…

…fore every query. Thanks for the patch, smurf@smurf.noris.de

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4267 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f21cbb40b2521da1195d1a2aa5910281efb32b7f 1 parent 7180207
@adrianholovaty adrianholovaty authored
Showing with 6 additions and 3 deletions.
  1. +1 −0  AUTHORS
  2. +5 −3 django/db/backends/mysql/base.py
View
1  AUTHORS
@@ -151,6 +151,7 @@ answer newbie questions, and generally made Django that much better:
serbaut@gmail.com
Pete Shinners <pete@shinners.org>
SmileyChris <smileychris@gmail.com>
+ smurf@smurf.noris.de
sopel
Thomas Steinacher <tom@eggdrop.ch>
nowell strite
View
8 django/db/backends/mysql/base.py
@@ -98,9 +98,11 @@ def cursor(self):
kwargs['port'] = int(settings.DATABASE_PORT)
kwargs.update(self.options)
self.connection = Database.connect(**kwargs)
- cursor = self.connection.cursor()
- if self.connection.get_server_info() >= '4.1':
- cursor.execute("SET NAMES 'utf8'")
+ cursor = self.connection.cursor()
+ if self.connection.get_server_info() >= '4.1':
+ cursor.execute("SET NAMES 'utf8'")
+ else:
+ cursor = self.connection.cursor()
if settings.DEBUG:
return util.CursorDebugWrapper(MysqlDebugWrapper(cursor), self)
return cursor
Please sign in to comment.
Something went wrong with that request. Please try again.