summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/elements.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index ef4587e18..8bf834d11 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -2057,12 +2057,9 @@ class BindParameter(roles.InElementRole, KeyedColumnElement[_T]):
:ref:`engine_thirdparty_caching`
"""
- return self.__class__(
- self.key,
- self.value,
- type_=self.type,
- literal_execute=True,
- )
+ c = ClauseElement._clone(self)
+ c.literal_execute = True
+ return c
def _negate_in_binary(self, negated_op, original_op):
if self.expand_op is original_op: