]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add "empty in" strategies; default to "static"
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 14 Mar 2017 16:00:56 +0000 (12:00 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 14 Mar 2017 21:01:07 +0000 (17:01 -0400)
commitf3b6f4f8da5223fae0a1dd948d4266b2e49e317c
tree9cae69a0b1680161a5e6604371a17b5766c3dc34
parent596e322543df6ff380243c9cb0cf9997252329f6
Add "empty in" strategies; default to "static"

The longstanding behavior of the :meth:`.Operators.in_` and
:meth:`.Operators.not_in_` operators emitting a warning when
the right-hand condition is an empty sequence has been revised;
a new flag :paramref:`.create_engine.empty_in_strategy` allows an
empty "IN" expression to generate a simple boolean expression, or
to invoke the previous behavior of dis-equating the expression to
itself, with or without a warning.  The default behavior is now
to emit the simple boolean expression, allowing an empty IN to
be evaulated without any performance penalty.

Change-Id: I65cc37f2d7cf65a59bf217136c42fee446929352
Fixes: #3907
doc/build/changelog/changelog_12.rst
doc/build/changelog/migration_12.rst
doc/build/faq/sqlexpressions.rst
lib/sqlalchemy/engine/__init__.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/default_comparator.py
lib/sqlalchemy/sql/operators.py
test/sql/test_compiler.py
test/sql/test_operators.py
test/sql/test_query.py