mirror of https://github.com/django/django.git
Fixed #27180 -- Fixed a crash in MySQL checks where SELECT @@sql_mode doesn't return a result.
This commit is contained in:
parent
8cae9bb772
commit
2b64ff68cc
|
@ -13,7 +13,7 @@ class DatabaseValidation(BaseDatabaseValidation):
|
|||
with self.connection.cursor() as cursor:
|
||||
cursor.execute("SELECT @@sql_mode")
|
||||
sql_mode = cursor.fetchone()
|
||||
modes = set(sql_mode[0].split(','))
|
||||
modes = set(sql_mode[0].split(',') if sql_mode else ())
|
||||
if not (modes & {'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES'}):
|
||||
return [checks.Warning(
|
||||
"MySQL Strict Mode is not set for database connection '%s'" % self.connection.alias,
|
||||
|
|
|
@ -9,4 +9,5 @@ Django 1.10.2 fixes several bugs in 1.10.1.
|
|||
Bugfixes
|
||||
========
|
||||
|
||||
* ...
|
||||
* Fixed a crash in MySQL database validation where ``SELECT @@sql_mode``
|
||||
doesn't return a result (:ticket:`27180`).
|
||||
|
|
Loading…
Reference in New Issue