Fixed bug where literal_binds compiler flag was not honored by the
:class:`.Insert` construct for the "multiple values" feature; the
subsequent values are now rendered as literals.
Change-Id: I81ac358fd59995885d482e7571620090210865d2
Fixes: #3880
sqlalchemy.sql.expression, due to mis-spelled "any_" and "all_"
functions.
+ .. change:: 3880
+ :tags: bg, sql
+ :tickets: 3880
+
+ Fixed bug where literal_binds compiler flag was not honored by the
+ :class:`.Insert` construct for the "multiple values" feature; the
+ subsequent values are now rendered as literals.
+
.. change:: 3877
:tags: bug, oracle, postgresql
:tickets: 3877
c,
(_create_bind_param(
compiler, c, row[c.key],
- name="%s_m%d" % (c.key, i + 1)
+ name="%s_m%d" % (c.key, i + 1), **kw
) if elements._is_literal(row[c.key])
else compiler.process(
row[c.key].self_group(), **kw))
'othername_m0': 'foo'}
)
+ def test_insert_multiple_values_literal_binds(self):
+ ins = self.tables.myothertable.insert().values([
+ {"othername": "foo"},
+ {"othername": "bar"},
+ ])
+ self.assert_compile(
+ ins,
+ "INSERT INTO myothertable (othername) VALUES ('foo'), ('bar')",
+ checkparams={},
+ literal_binds=True
+ )
+
def test_insert_multiple_values_return_defaults(self):
# TODO: not sure if this should raise an
# error or what