Django

Code

Changeset 4267

Show
Ignore:
Timestamp:
12/30/06 01:21:01 (2 years ago)
Author:
adrian
Message:

Fixed #3151 -- Improved MySQL backend not to send 'SET NAMES utf8' before every query. Thanks for the patch, smurf@smurf.noris.de

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/AUTHORS

    r4231 r4267  
    152152    Pete Shinners <pete@shinners.org> 
    153153    SmileyChris <smileychris@gmail.com> 
     154    smurf@smurf.noris.de 
    154155    sopel 
    155156    Thomas Steinacher <tom@eggdrop.ch> 
  • django/trunk/django/db/backends/mysql/base.py

    r4265 r4267  
    9999            kwargs.update(self.options) 
    100100            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() 
    104106        if settings.DEBUG: 
    105107            return util.CursorDebugWrapper(MysqlDebugWrapper(cursor), self)