summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/compiler.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-04-09 12:39:08 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-04-09 12:39:08 +0000
commite9bbdb39de3047761fa8d03d5241eccd571093ff (patch)
treeea5a37276a396584f453704da648cfe8799ccf4b /django/db/backends/mysql/compiler.py
parent056c940f0d723eb66fc06b43c28a743c84d54b3b (diff)
downloaddjango-e9bbdb39de3047761fa8d03d5241eccd571093ff.tar.gz
Fixed #13293 -- Corrected a problem with the MySQL handling of boolean return values when a query has an extra() clause. Thanks to mk for the report and draft patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12939 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/mysql/compiler.py')
-rw-r--r--django/db/backends/mysql/compiler.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/db/backends/mysql/compiler.py b/django/db/backends/mysql/compiler.py
index 07832f27f0..bd4105ff8e 100644
--- a/django/db/backends/mysql/compiler.py
+++ b/django/db/backends/mysql/compiler.py
@@ -3,13 +3,13 @@ from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def resolve_columns(self, row, fields=()):
values = []
- for value, field in map(None, row, fields):
+ index_extra_select = len(self.query.extra_select.keys())
+ for value, field in map(None, row[index_extra_select:], fields):
if (field and field.get_internal_type() in ("BooleanField", "NullBooleanField") and
value in (0, 1)):
value = bool(value)
values.append(value)
- return tuple(values)
-
+ return row[:index_extra_select] + tuple(values)
class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler):
pass