mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	[1.10.x] Fixed #26991 -- Fixed a crash in MySQL where SELECT @@SQL_AUTO_IS_NULL doesn't return a result.
Backport of 431cbd115b from master
			
			
This commit is contained in:
		| @@ -75,4 +75,5 @@ class DatabaseFeatures(BaseDatabaseFeatures): | |||||||
|     def is_sql_auto_is_null_enabled(self): |     def is_sql_auto_is_null_enabled(self): | ||||||
|         with self.connection.cursor() as cursor: |         with self.connection.cursor() as cursor: | ||||||
|             cursor.execute('SELECT @@SQL_AUTO_IS_NULL') |             cursor.execute('SELECT @@SQL_AUTO_IS_NULL') | ||||||
|             return cursor.fetchone()[0] == 1 |             result = cursor.fetchone() | ||||||
|  |             return result and result[0] == 1 | ||||||
|   | |||||||
| @@ -9,4 +9,5 @@ Django 1.10.1 fixes several bugs in 1.10. | |||||||
| Bugfixes | Bugfixes | ||||||
| ======== | ======== | ||||||
|  |  | ||||||
| * ... | * Fixed a crash in MySQL connections where ``SELECT @@SQL_AUTO_IS_NULL`` | ||||||
|  |   doesn't return a result (:ticket:`26991`). | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user