diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-11-26 12:10:25 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-11-26 12:21:22 -0500 |
commit | 6125dfff91ca0093a00d78804917240617825c44 (patch) | |
tree | 928cd035b4b000b41eac72aa300957cec56626bf /test/dialect/oracle/test_compiler.py | |
parent | 2759eefbf32862be464ecd5b1e91163c7773df39 (diff) | |
download | sqlalchemy-6125dfff91ca0093a00d78804917240617825c44.tar.gz |
Don't discard leftovers from surface_selectables
Fixed regression introduced in 1.3.2 for the PostgreSQL dialect, also
copied out to the MySQL dialect's feature in 1.3.18, where usage of a non
:class:`_schema.Table` construct such as :func:`_sql.text` as the argument
to :paramref:`_sql.Select.with_for_update.of` would fail to be accommodated
correctly within the PostgreSQL or MySQL compilers.
Fixes: #5729
Change-Id: I265bcc171f0eb865ac3910ee805b162f3b70e2c1
Diffstat (limited to 'test/dialect/oracle/test_compiler.py')
-rw-r--r-- | test/dialect/oracle/test_compiler.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/dialect/oracle/test_compiler.py b/test/dialect/oracle/test_compiler.py index 869cffe44..20c579f64 100644 --- a/test/dialect/oracle/test_compiler.py +++ b/test/dialect/oracle/test_compiler.py @@ -448,6 +448,24 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "mytable_1.myid, mytable_1.name", ) + # ensure of=text() for of works + self.assert_compile( + table1.select(table1.c.myid == 7).with_for_update( + read=True, of=text("table1") + ), + "SELECT mytable.myid, mytable.name, mytable.description " + "FROM mytable WHERE mytable.myid = :myid_1 FOR UPDATE OF table1", + ) + + # ensure of=literal_column() for of works + self.assert_compile( + table1.select(table1.c.myid == 7).with_for_update( + read=True, of=literal_column("table1") + ), + "SELECT mytable.myid, mytable.name, mytable.description " + "FROM mytable WHERE mytable.myid = :myid_1 FOR UPDATE OF table1", + ) + def test_for_update_of_w_limit_adaption_col_present(self): table1 = table("mytable", column("myid"), column("name")) |