Fixed #26991 -- Fixed a crash in MySQL where SQL_AUTO_IS_NULL doesn't return a result.

This commit is contained in:
Tim Graham 2016-08-02 10:52:31 -04:00 committed by GitHub
parent 013ee21cf8
commit d95c669c29
2 changed files with 4 additions and 2 deletions

View File

@ -75,4 +75,5 @@ class DatabaseFeatures(BaseDatabaseFeatures):
def is_sql_auto_is_null_enabled(self):
with self.connection.cursor() as cursor:
cursor.execute('SELECT @@SQL_AUTO_IS_NULL')
return cursor.fetchone()[0] == 1
result = cursor.fetchone()
return result and result[0] == 1

View File

@ -9,4 +9,5 @@ Django 1.10.1 fixes several bugs in 1.10.
Bugfixes
========
* ...
* Fixed a crash in MySQL connections where ``SELECT @@SQL_AUTO_IS_NULL``
doesn't return a result (:ticket:`26991`).