Django

Code

Changeset 1878

Show
Ignore:
Timestamp:
01/08/06 19:55:37 (3 years ago)
Author:
adrian
Message:

Fixed #1121 -- Changed MySQL backend to use correct character set in MySQL 4.1x/5.x on Win32. Thanks, hipertracker@gmail.com

Files:

Legend:

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

    r1872 r1878  
    5353    Gustavo Picon 
    5454    Brant Harris 
     55    hipertracker@gmail.com 
    5556    Ian Holsman <http://feh.holsman.net/> 
    5657    Kieran Holland <http://www.kieranholland.com> 
  • django/trunk/django/core/db/backends/mysql.py

    r1744 r1878  
    6666                kwargs['port'] = DATABASE_PORT 
    6767            self.connection = Database.connect(**kwargs) 
     68        cursor = self.connection.cursor() 
     69        if self.connection.get_server_info() >= '4.1': 
     70            cursor.execute("SET NAMES utf8") 
    6871        if DEBUG: 
    69             return base.CursorDebugWrapper(MysqlDebugWrapper(self.connection.cursor()), self) 
    70         return self.connection.cursor() 
     72            return base.CursorDebugWrapper(MysqlDebugWrapper(cursor), self) 
     73        return cursor 
    7174 
    7275    def commit(self):