Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Adrian Holovaty authored December 30, 2006
1  AUTHORS
@@ -151,6 +151,7 @@ answer newbie questions, and generally made Django that much better:
151 151
     serbaut@gmail.com
152 152
     Pete Shinners <pete@shinners.org>
153 153
     SmileyChris <smileychris@gmail.com>
  154
+    smurf@smurf.noris.de
154 155
     sopel
155 156
     Thomas Steinacher <tom@eggdrop.ch>
156 157
     nowell strite
8  django/db/backends/mysql/base.py
@@ -98,9 +98,11 @@ def cursor(self):
98 98
                 kwargs['port'] = int(settings.DATABASE_PORT)
99 99
             kwargs.update(self.options)
100 100
             self.connection = Database.connect(**kwargs)
101  
-        cursor = self.connection.cursor()
102  
-        if self.connection.get_server_info() >= '4.1':
103  
-            cursor.execute("SET NAMES 'utf8'")
  101
+            cursor = self.connection.cursor()
  102
+            if self.connection.get_server_info() >= '4.1':
  103
+                cursor.execute("SET NAMES 'utf8'")
  104
+        else:
  105
+            cursor = self.connection.cursor()
104 106
         if settings.DEBUG:
105 107
             return util.CursorDebugWrapper(MysqlDebugWrapper(cursor), self)
106 108
         return cursor

0 notes on commit f21cbb4

Please sign in to comment.
Something went wrong with that request. Please try again.