diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-04-05 16:32:14 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-04-05 19:30:19 -0400 |
| commit | 279d185058ecf322b0c7a1fc8263dbf4da56e9b7 (patch) | |
| tree | 3f2aea8c95ac3f8a825f974a9228a983af823ba4 /lib/sqlalchemy/testing/suite | |
| parent | 165c3a65dcb1ba3f42ecf2b5da7c298bdc259f9b (diff) | |
| download | sqlalchemy-279d185058ecf322b0c7a1fc8263dbf4da56e9b7.tar.gz | |
uniquify when popping literal_execute_params from param dict
Fixed further issues in the same area as that of :ticket:`6173` released in
1.4.5, where a "postcompile" parameter, again most typically those used for
LIMIT/OFFSET rendering in Oracle and SQL Server, would fail to be processed
correctly if the same parameter rendered in multiple places in the
statement.
Fixes: #6202
Change-Id: I95c355aa52a7546fe579ad67f9a8402a213cb79d
Diffstat (limited to 'lib/sqlalchemy/testing/suite')
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_select.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py index c519154f6..7318a4f33 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -223,6 +223,20 @@ class FetchLimitOffsetTest(fixtures.TablesTest): [(1, 1, 2), (2, 2, 3), (3, 3, 4)], ) + def test_limit_render_multiple_times(self, connection): + table = self.tables.some_table + stmt = select(table.c.id).limit(1).scalar_subquery() + + u = union(select(stmt), select(stmt)).subquery().select() + + self._assert_result( + connection, + u, + [ + (1,), + ], + ) + @testing.requires.fetch_first def test_simple_fetch(self, connection): table = self.tables.some_table |
