produces the negation of the expression "IN" returns
when used against an empty collection. Also in 0.8.3.
.. changelog::
:version: 0.8.3
+ .. change::
+ :tags: bug, sql
+
+ The :meth:`.Operators.notin_` operator added in 0.8 now properly
+ produces the negation of the expression "IN" returns
+ when used against an empty collection.
+
.. change::
:tags: mysql, bug
:tickets: 2791
'contradiction, which nonetheless can be '
'expensive to evaluate. Consider alternative '
'strategies for improved performance.' % expr)
- return expr != expr
+ if op is operators.in_op:
+ return expr != expr
+ else:
+ return expr == expr
return self._boolean_compare(expr, op,
ClauseList(*args).self_group(against=op),
"mytable.myid IN (NULL)"
)
+ @testing.emits_warning('.*empty sequence.*')
+ def test_in_29(self):
+ self.assert_compile(self.table1.c.myid.notin_([]),
+ "mytable.myid = mytable.myid")
+
+ @testing.emits_warning('.*empty sequence.*')
+ def test_in_30(self):
+ self.assert_compile(~self.table1.c.myid.in_([]),
+ "mytable.myid = mytable.myid")
+
+
class MathOperatorTest(fixtures.TestBase, testing.AssertsCompiledSQL):
__dialect__ = 'default'