Author: adrian
Date: 2006-12-30 01:21:01 -0600 (Sat, 30 Dec 2006)
New Revision: 4267

Modified:
  django/trunk/AUTHORS
  django/trunk/django/db/backends/mysql/base.py
Log:
Fixed #3151 -- Improved MySQL backend not to send 'SET NAMES utf8' before every 
query. Thanks for the patch, [EMAIL PROTECTED]

Modified: django/trunk/AUTHORS
===================================================================
--- django/trunk/AUTHORS        2006-12-30 07:16:25 UTC (rev 4266)
+++ django/trunk/AUTHORS        2006-12-30 07:21:01 UTC (rev 4267)
@@ -151,6 +151,7 @@
    [EMAIL PROTECTED]
    Pete Shinners <[EMAIL PROTECTED]>
    SmileyChris <[EMAIL PROTECTED]>
+    [EMAIL PROTECTED]
    sopel
    Thomas Steinacher <[EMAIL PROTECTED]>
    nowell strite

Modified: django/trunk/django/db/backends/mysql/base.py
===================================================================
--- django/trunk/django/db/backends/mysql/base.py       2006-12-30 07:16:25 UTC 
(rev 4266)
+++ django/trunk/django/db/backends/mysql/base.py       2006-12-30 07:21:01 UTC 
(rev 4267)
@@ -98,9 +98,11 @@
                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


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django 
updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to