diff options
| author | Markus Gerards <mail@markus-gerards.de> | 2016-09-07 13:43:51 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-09-07 11:15:41 -0400 |
| commit | 2b64ff68cc375b5688174b4087bf44be9edd2558 (patch) | |
| tree | c874283c3608064b62e660c03ef525a35f97222b /django/db | |
| parent | 8cae9bb77299794187b60f0489ac27dd403cf646 (diff) | |
Fixed #27180 -- Fixed a crash in MySQL checks where SELECT @@sql_mode doesn't return a result.
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/backends/mysql/validation.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/backends/mysql/validation.py b/django/db/backends/mysql/validation.py index e62a6e4c7e..5a50663dd2 100644 --- a/django/db/backends/mysql/validation.py +++ b/django/db/backends/mysql/validation.py @@ -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, |
