diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-04-04 13:36:28 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-04-04 16:46:16 -0400 |
| commit | b4eb29253cb29a069973503f36d1103d4a18311c (patch) | |
| tree | d74797804981a1234b993569fa426e78ba7a6e00 /test/sql | |
| parent | 9f986ce10c6755af3f347a56f9ea03e0e2c5943e (diff) | |
| download | sqlalchemy-b4eb29253cb29a069973503f36d1103d4a18311c.tar.gz | |
Ensure all visit_sequence accepts **kw args
Fixed issue where the compilation of an INSERT statement with the
"literal_binds" option that also uses an explicit sequence and "inline"
generation, as on Postgresql and Oracle, would fail to accommodate the
extra keyword argument within the sequence processing routine.
Change-Id: Ibdab7d340aea7429a210c9535ccf1a3e85f074fb
Fixes: #4231
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_compiler.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index 25eb2b24b..0ef19e0cb 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -19,7 +19,7 @@ from sqlalchemy import Integer, String, MetaData, Table, Column, select, \ literal, and_, null, type_coerce, alias, or_, literal_column,\ Float, TIMESTAMP, Numeric, Date, Text, union, except_,\ intersect, union_all, Boolean, distinct, join, outerjoin, asc, desc,\ - over, subquery, case, true, CheckConstraint + over, subquery, case, true, CheckConstraint, Sequence import decimal from sqlalchemy.util import u from sqlalchemy import exc, sql, util, types, schema @@ -2955,6 +2955,19 @@ class CRUDTest(fixtures.TestBase, AssertsCompiledSQL): "INSERT INTO mytable (myid, name) VALUES (3, 'jack')", literal_binds=True) + def test_insert_literal_binds_sequence_notimplemented(self): + table = Table('x', MetaData(), Column('y', Integer, Sequence('y_seq'))) + dialect = default.DefaultDialect() + dialect.supports_sequences = True + + stmt = table.insert().values(myid=3, name='jack') + + assert_raises( + NotImplementedError, + stmt.compile, + compile_kwargs=dict(literal_binds=True), dialect=dialect + ) + def test_update_literal_binds(self): stmt = table1.update().values(name='jack').\ where(table1.c.name == 'jill') |
