diff options
| author | Josh Smeaton <josh.smeaton@gmail.com> | 2015-01-07 21:30:25 +1100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-01-07 19:07:49 -0500 |
| commit | 8713ea7568af8871bf1306f14cc928058df0d4c7 (patch) | |
| tree | bf85b55ee5aeb25c0571f9fb54d380b94724f328 /django | |
| parent | 1f03d2d924ba90e83dc9d8c93438bf5ee2f17ccd (diff) | |
Fixed null handling in Value expression
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/expressions.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py index ac69307edc..9fe3a35fee 100644 --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -483,6 +483,11 @@ class Value(ExpressionNode): self.value = value def as_sql(self, compiler, connection): + if self.value is None: + # cx_Oracle does not always convert None to the appropriate + # NULL type (like in case expressions using numbers), so we + # use a literal SQL NULL + return 'NULL', [] return '%s', [self.value] |
