Fixed #3151 -- Improved MySQL backend not to send 'SET NAMES utf8' before 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
This commit is contained in:
parent
7180207328
commit
f21cbb40b2
1
AUTHORS
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
|
||||
|
|
|
@ -98,9 +98,11 @@ class DatabaseWrapper(local):
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue