]> 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)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 3 Nov 2025 15:32:25 +0000 (10:32 -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
(cherry picked from commit a87faba35a65563447c8204cc47eb37ab47e216e)

lib/sqlalchemy/testing/suite/test_select.py
lib/sqlalchemy/testing/suite/test_types.py

index d67d76987673f242b7663b6bce314c697c604df3..84a18e3e7d55eaa658cfa131bfca3838a1a8195a 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 5f1bf75d504836b7b8b9abe3e401117788143444..b22907bb7391f26065ce84f67c1e583932acfca5 100644 (file)
@@ -432,7 +432,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,
         )