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:19:25 -0400 |
| commit | baa1790b4ddd5e7836170743aa058c834b7b2040 (patch) | |
| tree | 1e4c98d444dfad404d41b33abdacbee1e536ed6e | |
| parent | a41405175a06ffa5e9f0f949578b275487aeaeda (diff) | |
[1.10.x] Fixed #27180 -- Fixed a crash in MySQL checks where SELECT @@sql_mode doesn't return a result.
Backport of 2b64ff68cc375b5688174b4087bf44be9edd2558 from master
| -rw-r--r-- | django/db/backends/mysql/validation.py | 2 | ||||
| -rw-r--r-- | docs/releases/1.10.2.txt | 3 |
2 files changed, 3 insertions, 2 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, diff --git a/docs/releases/1.10.2.txt b/docs/releases/1.10.2.txt index 4154836a1d..f3c574d7d1 100644 --- a/docs/releases/1.10.2.txt +++ b/docs/releases/1.10.2.txt @@ -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`). |
