Ticket #27180: 27180.diff

File 27180.diff, 1.1 KB (added by Markus Gerards, 8 years ago)
  • django/db/backends/mysql/validation.py

    diff --git a/django/db/backends/mysql/validation.py b/django/db/backends/mysql/validation.py
    index e62a6e4..c86a082 100644
    a b class DatabaseValidation(BaseDatabaseValidation):  
    1313        with self.connection.cursor() as cursor:
    1414            cursor.execute("SELECT @@sql_mode")
    1515            sql_mode = cursor.fetchone()
    16         modes = set(sql_mode[0].split(','))
     16           
     17        if sql_mode:
     18            modes = set(sql_mode[0].split(','))
     19        else:
     20            modes = set()
     21
    1722        if not (modes & {'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES'}):
    1823            return [checks.Warning(
    1924                "MySQL Strict Mode is not set for database connection '%s'" % self.connection.alias,
  • docs/releases/1.10.2.txt

    diff --git a/docs/releases/1.10.2.txt b/docs/releases/1.10.2.txt
    index 4154836..f3c574d 100644
    a b Django 1.10.2 fixes several bugs in 1.10.1.  
    99Bugfixes
    1010========
    1111
    12 * ...
     12* Fixed a crash in MySQL database validation where ``SELECT @@sql_mode``
     13  doesn't return a result (:ticket:`27180`).
Back to Top