From a87faba35a65563447c8204cc47eb37ab47e216e Mon Sep 17 00:00:00 2001 From: Pat Buxton Date: Mon, 3 Nov 2025 09:49:33 -0500 Subject: [PATCH] Add order by clause to dialect tests to ensure expected result order ### Description Failing for Starrocks dialect currently without overrides, the amended dialect tests require an order by clause to ensure the expected result. ### Checklist This pull request is: - [x] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #` in the commit message - please include tests. one line code fixes without tests will not be accepted. Fixes https://github.com/sqlalchemy/sqlalchemy/issues/12956 Closes: #12957 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12957 Pull-request-sha: 271a014896e0c3d994112dec19029261d4507b6d Change-Id: Ib8f5bc1caf014026071b83f57011c43c02043746 --- lib/sqlalchemy/testing/suite/test_select.py | 4 +++- lib/sqlalchemy/testing/suite/test_types.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py index 6b21bb67fe..83c1a1678f 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -234,7 +234,9 @@ class FetchLimitOffsetTest(fixtures.TablesTest): def test_limit_render_multiple_times(self, connection): table = self.tables.some_table - stmt = select(table.c.id).limit(1).scalar_subquery() + stmt = ( + select(table.c.id).order_by(table.c.id).limit(1).scalar_subquery() + ) u = union(select(stmt), select(stmt)).subquery().select() diff --git a/lib/sqlalchemy/testing/suite/test_types.py b/lib/sqlalchemy/testing/suite/test_types.py index 112a5d0df1..bf720d9193 100644 --- a/lib/sqlalchemy/testing/suite/test_types.py +++ b/lib/sqlalchemy/testing/suite/test_types.py @@ -433,7 +433,9 @@ class StringTest(_LiteralRoundTripFixture, fixtures.TestBase): connection.execute(t.insert(), [{"x": "AB"}, {"x": "BC"}, {"x": "AC"}]) eq_( - connection.scalars(select(t.c.x).where(t.c.x.like(expr))).all(), + connection.scalars( + select(t.c.x).where(t.c.x.like(expr)).order_by(t.c.x) + ).all(), expected, ) -- 2.47.3