mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed a regression introduced in where.as_sql() refactor
At least Oracle needs parentheses in negated where conditions, even if
there is only single condition negated. Fixed this by reverting to old
logic in that part of as_sql() and adding a comment about this.
I did not investigate why the parentheses are needed. The original
offending commit was bd283aa844.
This commit is contained in:
parent
f572ee0c65
commit
e74787391e
2 changed files with 7 additions and 4 deletions
|
|
@ -2091,7 +2091,7 @@ class WhereNodeTest(TestCase):
|
|||
w = WhereNode(children=[NothingNode(), self.DummyNode()], connector='OR')
|
||||
self.assertEquals(w.as_sql(qn, connection), ('dummy', []))
|
||||
w.negate()
|
||||
self.assertEquals(w.as_sql(qn, connection), ('NOT dummy', []))
|
||||
self.assertEquals(w.as_sql(qn, connection), ('NOT (dummy)', []))
|
||||
|
||||
def test_empty_nodes(self):
|
||||
qn = connection.ops.quote_name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue