summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index dedd75f5c..734e65492 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -1904,32 +1904,14 @@ class SQLCompiler(Compiled):
binary, override_operator=operators.match_op
)
- def visit_in_op_binary(self, binary, operator, **kw):
- return self._render_in_expr_w_bindparam(binary, operator, **kw)
-
def visit_not_in_op_binary(self, binary, operator, **kw):
# The brackets are required in the NOT IN operation because the empty
# case is handled using the form "(col NOT IN (null) OR 1 = 1)".
# The presence of the OR makes the brackets required.
- return "(%s)" % self._render_in_expr_w_bindparam(
- binary, operator, **kw
+ return "(%s)" % self._generate_generic_binary(
+ binary, OPERATORS[operator], **kw
)
- def _render_in_expr_w_bindparam(self, binary, operator, **kw):
- opstring = OPERATORS[operator]
-
- if isinstance(binary.right, elements.BindParameter):
- if not binary.right.expanding or not binary.right.expand_op:
- # note that by cloning here, we rely upon the
- # _cache_key_bind_match dictionary to resolve
- # clones of bindparam() objects to the ones that are
- # present in our cache key.
- binary.right = binary.right._clone(maintain_key=True)
- binary.right.expanding = True
- binary.right.expand_op = operator
-
- return self._generate_generic_binary(binary, opstring, **kw)
-
def visit_empty_set_op_expr(self, type_, expand_op):
if expand_op is operators.not_in_op:
if len(type_) > 1: