]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Add order by clause to dialect tests to ensure expected result order
authorPat Buxton <patrick.buxton@tartansolutions.com>
Mon, 3 Nov 2025 14:49:33 +0000 (09:49 -0500)
committersqla-tester <sqla-tester@sqlalchemy.org>
Mon, 3 Nov 2025 14:49:33 +0000 (09:49 -0500)
<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
Failing for Starrocks dialect currently without overrides, the amended dialect tests require an order by clause to ensure the expected result.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

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: #<issue number>` 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
lib/sqlalchemy/testing/suite/test_types.py

index 6b21bb67fe2dfca9c4578f1b622503cc379b7c1c..83c1a1678fe0904541432acca8df118431218fad 100644 (file)
@@ -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()
 
index 112a5d0df13e6471c99ebc107c9c2dba84e9658f..bf720d9193dd88b8a50239d4a47fc81cabd38312 100644 (file)
@@ -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,
         )