From: Allen Chen Date: Thu, 2 Oct 2025 05:49:15 +0000 (+0800) Subject: fix: clustered index return with correct order X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71b47cce0ee8794789e8ee28ec5fd8264ef2fbdb;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix: clustered index return with correct order --- diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index ff67ee1ef5..66c9925e74 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -3479,6 +3479,9 @@ join sys.schemas as sch on where tab.name = :tabname and sch.name = :schname +order by + ind_col.index_id, + ind_col.key_ordinal """ ) .bindparams(