Skip to content

Fix mssql index column order#12895

Closed
e2ne0 wants to merge 5 commits intosqlalchemy:mainfrom
e2ne0:fix-mssql-index-column-order
Closed

Fix mssql index column order#12895
e2ne0 wants to merge 5 commits intosqlalchemy:mainfrom
e2ne0:fix-mssql-index-column-order

Conversation

@e2ne0
Copy link
Copy Markdown
Contributor

@e2ne0 e2ne0 commented Oct 2, 2025

Description

This pr make mssql clustered index columns return with correct order.
Fixes: #12894
Closes: #12894

local test:
before

(venv) e2ne0@MacBook-Pro .../GitHub/sqlalchemy (fix-mssql-index-column-order*) % pytest test/dialect/mssql/test_reflection.py --db docker_mssql -v
================================================================ sqlalchemy installation ================================================================
SQLAlchemy 2.1.0b1 (user site loaded)
Path: /Users/e2ne0/Documents/GitHub/sqlalchemy/lib/sqlalchemy/__init__.py
compiled extension enabled, e.g. /Users/e2ne0/Documents/GitHub/sqlalchemy/lib/sqlalchemy/engine/_util_cy.cpython-311-darwin.so 
================================================================== test session starts ==================================================================
platform darwin -- Python 3.11.13, pytest-8.4.2, pluggy-1.6.0 -- /Users/e2ne0/Documents/GitHub/sqlalchemy/venv/bin/python3
cachedir: .pytest_cache
rootdir: /Users/e2ne0/Documents/GitHub/sqlalchemy
configfile: pyproject.toml
collected 65 items                                                                                                                                      

test/dialect/mssql/test_reflection.py::IdentityReflectionTest_mssql+pyodbc_15_0_4445_1::test_reflect_identity PASSED                              [  1%]
test/dialect/mssql/test_reflection.py::IdentityReflectionTest_mssql+pyodbc_15_0_4445_1::test_reflect_views PASSED                                 [  3%]
test/dialect/mssql/test_reflection.py::InfoCoerceUnicodeTest::test_info_unicode_cast PASSED                                                       [  4%]
test/dialect/mssql/test_reflection.py::InfoCoerceUnicodeTest::test_info_unicode_cast_no_2000 PASSED                                               [  6%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_default_schema_name_not_interpreted_as_tokenized PASSED                              [  7%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[Foo.Bar-Foo-Bar-use [Foo]] PASSED                               [  9%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[[Foo.Bar]-None-Foo.Bar-use [Foo.Bar]] PASSED                    [ 10%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[[Foo.Bar].[bat]-Foo.Bar-bat-use [Foo.Bar]] PASSED               [ 12%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[[abc].[def].[efg].[hij]-[abc].[def].[efg]-hij-use [abc].[def].[efg]] PASSED [ 13%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[[foo].]do something; select [foo-foo-do something; select foo-use foo] PASSED [ 15%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[abc.def.efg.hij-abc.def.efg-hij-use [abc.def.efg]] PASSED       [ 16%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[foo-None-foo-use foo] PASSED                                    [ 18%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[foo.bar-foo-bar-use foo] PASSED                                 [ 20%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[something; select [foo].bar-something; select foo-bar-use [something; select foo]] PASSED [ 21%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs_dont_use_for_same_db PASSED                                     [ 23%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs_switch_for_different_db PASSED                                  [ 24%]
test/dialect/mssql/test_reflection.py::ReflectHugeViewTest_mssql+pyodbc_15_0_4445_1::test_inspect_view_definition PASSED                          [ 26%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[FLOAT-FLOAT(53)] PASSED                       [ 27%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[IMAGE-IMAGE] PASSED                           [ 29%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[MONEY-MONEY] PASSED                           [ 30%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[REAL-REAL] PASSED                             [ 32%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[XML-XML] PASSED                               [ 33%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[type_obj3-NUMERIC(10, 2)] PASSED              [ 35%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[type_obj6-REAL] PASSED                        [ 36%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_basic_reflection PASSED                                      [ 38%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_comments PASSED                                              [ 40%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_comments_not_supported PASSED                                [ 41%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_comments_with_dropped_column PASSED                          [ 43%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_cross_schema_fk_pk_name_overlaps PASSED                      [ 44%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_db_qualified_items PASSED                                    [ 46%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_fk_on_unique_index PASSED                                    [ 47%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_global_temp_different_collation PASSED                       [ 49%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_temp_not_present_but_another_session PASSED        [ 50%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_temp_temp_present_both_sessions PASSED             [ 52%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_temporary[global_temp] PASSED                      [ 53%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_temporary[local_temp] PASSED                       [ 55%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_temporary[nonexistent] PASSED                      [ 56%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[get_columns-[test_schema]] PASSED [ 58%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[get_columns-test_schema] PASSED [ 60%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[has_table-[test_schema]] PASSED [ 61%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[has_table-test_schema] PASSED [ 63%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[reflect_table-[test_schema]] PASSED [ 64%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[reflect_table-test_schema] PASSED [ 66%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_identity PASSED                                              [ 67%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_column_order_clustered FAILED                          [ 69%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_column_order_nonclustered PASSED                       [ 70%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_clustered PASSED                            [ 72%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_colstore_clustered PASSED                   [ 73%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_colstore_nonclustered PASSED                [ 75%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_colstore_nonclustered_multicol PASSED       [ 76%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_colstore_nonclustered_none PASSED           [ 78%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_filtered_and_clustered PASSED               [ 80%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_nonclustered PASSED                         [ 81%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_indexes_cols PASSED                                          [ 83%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_indexes_cols_with_commas PASSED                              [ 84%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_indexes_cols_with_spaces PASSED                              [ 86%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_indexes_with_filtered PASSED                                 [ 87%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_max_ident_in_varchar_not_present PASSED                      [ 89%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_primary_key_reflection_clustered PASSED                      [ 90%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_primary_key_reflection_nonclustered PASSED                   [ 92%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_skip_types PASSED                                            [ 93%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_table_name_that_is_greater_than_16_chars PASSED              [ 95%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_temporary_table[global_temp] PASSED                          [ 96%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_temporary_table[local_temp] PASSED                           [ 98%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_temporary_table[nonexistent] PASSED                          [100%]

======================================================================= FAILURES ========================================================================
_______________________________________ ReflectionTest_mssql+pyodbc_15_0_4445_1.test_index_column_order_clustered _______________________________________
Traceback (most recent call last):
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/_pytest/runner.py", line 344, in from_call
    result: TResult | None = func()
                             ^^^^^^
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/_pytest/runner.py", line 246, in <lambda>
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/_pytest/logging.py", line 850, in pytest_runtest_call
    yield
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/_pytest/capture.py", line 900, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/_pytest/skipping.py", line 263, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/_pytest/runner.py", line 178, in pytest_runtest_call
    item.runtest()
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/_pytest/python.py", line 1671, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/venv/lib/python3.11/site-packages/_pytest/python.py", line 157, in pytest_pyfunc_call
    result = testfunction(**testargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/test/dialect/mssql/test_reflection.py", line 737, in test_index_column_order_clustered
    eq_(indexes[0]["column_names"], ["y", "id", "x"])
  File "/Users/e2ne0/Documents/GitHub/sqlalchemy/lib/sqlalchemy/testing/assertions.py", line 289, in eq_
    assert a == b, msg or "%r != %r" % (a, b)
AssertionError: ['id', 'x', 'y'] != ['y', 'id', 'x']
assert ['id', 'x', 'y'] == ['y', 'id', 'x']
  
  At index 0 diff: 'id' != 'y'
  
  Full diff:
    [
  -     'y',
        'id',
        'x',
  +     'y',
    ]
================================================================ short test summary info ================================================================
FAILED test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_column_order_clustered - AssertionError: ['id', 'x', 'y'] != ['y', 'id', 'x']
assert ['id', 'x', 'y'] == ['y', 'id', 'x']
  
  At index 0 diff: 'id' != 'y'
  
  Full diff:
    [
  -     'y',
        'id',
        'x',
  +     'y',
    ]
============================================================= 1 failed, 64 passed in 2.39s ==============================================================

after

(venv) e2ne0@MacBook-Pro .../GitHub/sqlalchemy (fix-mssql-index-column-order*) % pytest test/dialect/mssql/test_reflection.py --db docker_mssql -v
================================================================ sqlalchemy installation ================================================================
SQLAlchemy 2.1.0b1 (user site loaded)
Path: /Users/e2ne0/Documents/GitHub/sqlalchemy/lib/sqlalchemy/__init__.py
compiled extension enabled, e.g. /Users/e2ne0/Documents/GitHub/sqlalchemy/lib/sqlalchemy/engine/_util_cy.cpython-311-darwin.so 
================================================================== test session starts ==================================================================
platform darwin -- Python 3.11.13, pytest-8.4.2, pluggy-1.6.0 -- /Users/e2ne0/Documents/GitHub/sqlalchemy/venv/bin/python3
cachedir: .pytest_cache
rootdir: /Users/e2ne0/Documents/GitHub/sqlalchemy
configfile: pyproject.toml
collected 65 items                                                                                                                                      

test/dialect/mssql/test_reflection.py::IdentityReflectionTest_mssql+pyodbc_15_0_4445_1::test_reflect_identity PASSED                              [  1%]
test/dialect/mssql/test_reflection.py::IdentityReflectionTest_mssql+pyodbc_15_0_4445_1::test_reflect_views PASSED                                 [  3%]
test/dialect/mssql/test_reflection.py::InfoCoerceUnicodeTest::test_info_unicode_cast PASSED                                                       [  4%]
test/dialect/mssql/test_reflection.py::InfoCoerceUnicodeTest::test_info_unicode_cast_no_2000 PASSED                                               [  6%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_default_schema_name_not_interpreted_as_tokenized PASSED                              [  7%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[Foo.Bar-Foo-Bar-use [Foo]] PASSED                               [  9%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[[Foo.Bar]-None-Foo.Bar-use [Foo.Bar]] PASSED                    [ 10%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[[Foo.Bar].[bat]-Foo.Bar-bat-use [Foo.Bar]] PASSED               [ 12%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[[abc].[def].[efg].[hij]-[abc].[def].[efg]-hij-use [abc].[def].[efg]] PASSED [ 13%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[[foo].]do something; select [foo-foo-do something; select foo-use foo] PASSED [ 15%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[abc.def.efg.hij-abc.def.efg-hij-use [abc.def.efg]] PASSED       [ 16%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[foo-None-foo-use foo] PASSED                                    [ 18%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[foo.bar-foo-bar-use foo] PASSED                                 [ 20%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs[something; select [foo].bar-something; select foo-bar-use [something; select foo]] PASSED [ 21%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs_dont_use_for_same_db PASSED                                     [ 23%]
test/dialect/mssql/test_reflection.py::OwnerPlusDBTest::test_owner_database_pairs_switch_for_different_db PASSED                                  [ 24%]
test/dialect/mssql/test_reflection.py::ReflectHugeViewTest_mssql+pyodbc_15_0_4445_1::test_inspect_view_definition PASSED                          [ 26%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[FLOAT-FLOAT(53)] PASSED                       [ 27%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[IMAGE-IMAGE] PASSED                           [ 29%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[MONEY-MONEY] PASSED                           [ 30%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[REAL-REAL] PASSED                             [ 32%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[XML-XML] PASSED                               [ 33%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[type_obj3-NUMERIC(10, 2)] PASSED              [ 35%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_assorted_types[type_obj6-REAL] PASSED                        [ 36%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_basic_reflection PASSED                                      [ 38%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_comments PASSED                                              [ 40%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_comments_not_supported PASSED                                [ 41%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_comments_with_dropped_column PASSED                          [ 43%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_cross_schema_fk_pk_name_overlaps PASSED                      [ 44%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_db_qualified_items PASSED                                    [ 46%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_fk_on_unique_index PASSED                                    [ 47%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_global_temp_different_collation PASSED                       [ 49%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_temp_not_present_but_another_session PASSED        [ 50%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_temp_temp_present_both_sessions PASSED             [ 52%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_temporary[global_temp] PASSED                      [ 53%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_temporary[local_temp] PASSED                       [ 55%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_temporary[nonexistent] PASSED                      [ 56%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[get_columns-[test_schema]] PASSED [ 58%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[get_columns-test_schema] PASSED [ 60%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[has_table-[test_schema]] PASSED [ 61%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[has_table-test_schema] PASSED [ 63%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[reflect_table-[test_schema]] PASSED [ 64%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_has_table_with_single_token_schema[reflect_table-test_schema] PASSED [ 66%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_identity PASSED                                              [ 67%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_column_order_clustered PASSED                          [ 69%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_column_order_nonclustered PASSED                       [ 70%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_clustered PASSED                            [ 72%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_colstore_clustered PASSED                   [ 73%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_colstore_nonclustered PASSED                [ 75%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_colstore_nonclustered_multicol PASSED       [ 76%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_colstore_nonclustered_none PASSED           [ 78%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_filtered_and_clustered PASSED               [ 80%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_index_reflection_nonclustered PASSED                         [ 81%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_indexes_cols PASSED                                          [ 83%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_indexes_cols_with_commas PASSED                              [ 84%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_indexes_cols_with_spaces PASSED                              [ 86%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_indexes_with_filtered PASSED                                 [ 87%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_max_ident_in_varchar_not_present PASSED                      [ 89%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_primary_key_reflection_clustered PASSED                      [ 90%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_primary_key_reflection_nonclustered PASSED                   [ 92%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_skip_types PASSED                                            [ 93%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_table_name_that_is_greater_than_16_chars PASSED              [ 95%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_temporary_table[global_temp] PASSED                          [ 96%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_temporary_table[local_temp] PASSED                           [ 98%]
test/dialect/mssql/test_reflection.py::ReflectionTest_mssql+pyodbc_15_0_4445_1::test_temporary_table[nonexistent] PASSED                          [100%]

================================================================== 65 passed in 1.85s ===================================================================

Checklist

  • Create test for mssql to check clustered and nonclustered index
  • Add test for the suite. thanks @zzzeek
  • Add order by command in sqlalchemy/dialects/mssql/base.py get_indexes() method

This pull request is:

  • 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.

Have a nice day!

@e2ne0
Copy link
Copy Markdown
Contributor Author

e2ne0 commented Oct 2, 2025

local test test/dialect/test_suite.py::ComponentReflectionTestExtra

(venv) e2ne0@MacBook-Pro .../GitHub/sqlalchemy (fix-mssql-index-column-order*) % pytest test/dialect/test_suite.py::ComponentReflectionTestExtra --db docker_mssql -v 
================================================================ sqlalchemy installation ================================================================
SQLAlchemy 2.1.0b1 (user site loaded)
Path: /Users/e2ne0/Documents/GitHub/sqlalchemy/lib/sqlalchemy/__init__.py
compiled extension enabled, e.g. /Users/e2ne0/Documents/GitHub/sqlalchemy/lib/sqlalchemy/engine/_util_cy.cpython-311-darwin.so 
================================================================== test session starts ==================================================================
platform darwin -- Python 3.11.13, pytest-8.4.2, pluggy-1.6.0 -- /Users/e2ne0/Documents/GitHub/sqlalchemy/venv/bin/python3
cachedir: .pytest_cache
rootdir: /Users/e2ne0/Documents/GitHub/sqlalchemy
configfile: pyproject.toml
collected 40 items                                                                                                                                      

test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[False-MyInline] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPED [  2%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[False-None] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPED [  5%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[False-my_inline] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPED [  7%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[True-MyInline] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPED [ 10%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[True-None] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPED [ 12%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[True-my_inline] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPED [ 15%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_mixed[False] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPED [ 17%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_mixed[True] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPED [ 20%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_no_constraint[False] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPEDnd custom function) [ 22%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_no_constraint[True] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPEDnd custom function) [ 25%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[False-MyCkConst] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPEDnd custom function) [ 27%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[False-None] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPEDnd custom function) [ 30%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[False-my_ck_const] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPEDnd custom function) [ 32%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[True-MyCkConst] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPEDnd custom function) [ 35%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[True-None] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPEDnd custom function) [ 37%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[True-my_ck_const] <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPEDnd custom function) [ 40%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_get_foreign_key_options[None-CASCADE-None-_exclusions_00] <- <string> PASSED [ 42%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_get_foreign_key_options[None-None-RESTRICT-_exclusions_04] <- <string> SKIPPEDs_04] (call)' : not postgresql and not sqlite and custom function) [ 45%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_get_foreign_key_options[None-None-SET NULL-_exclusions_01] <- <string> PASSED [ 47%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_get_foreign_key_options[None-RESTRICT-None-_exclusions_05] <- <string> SKIPPEDs_05] (call)' : not postgresql and not sqlite and custom function) [ 50%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_get_foreign_key_options[expected2-None-NO ACTION-_exclusions_02] <- <string> PASSED [ 52%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_get_foreign_key_options[expected3-NO ACTION-None-_exclusions_03] <- <string> PASSED [ 55%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_index_column_order[False] <- lib/sqlalchemy/testing/suite/test_reflection.py PASSED [ 57%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_index_column_order[True] <- lib/sqlalchemy/testing/suite/test_reflection.py PASSED [ 60%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_nullable_reflection <- lib/sqlalchemy/testing/suite/test_reflection.py PASSED [ 62%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_numeric_reflection <- lib/sqlalchemy/testing/suite/test_reflection.py PASSED [ 65%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_reflect_covering_index <- lib/sqlalchemy/testing/suite/test_reflection.py PASSED [ 67%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_reflect_expression_based_indexes <- lib/sqlalchemy/testing/suite/test_reflection.py SKIPPED not oracle) [ 70%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_server_defaults[Boolean-default2-1|true-_exclusions_02] <- <string> PASSED [ 72%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_server_defaults[DateTime-default5-current_timestamp|now|getdate-_exclusions_05] <- <string> PASSED [ 75%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_server_defaults[Integer-10-'?10'?-_exclusions_01] <- <string> PASSED [ 77%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_server_defaults[Integer-default0-'?10'?-_exclusions_00] <- <string> PASSED [ 80%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_server_defaults[Integer-default3-3\\+5-_exclusions_03] <- <string> PASSED [ 82%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_server_defaults[Integer-default4-3\\*5-_exclusions_04] <- <string> PASSED [ 85%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_server_defaults[Integer-default6-3\\+5-_exclusions_06] <- <string> PASSED [ 87%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_string_length_reflection[CHAR-_exclusions_02] <- <string> PASSED [ 90%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_string_length_reflection[NCHAR-_exclusions_04] <- <string> PASSED [ 92%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_string_length_reflection[NVARCHAR-_exclusions_03] <- <string> PASSED [ 95%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_string_length_reflection[String-_exclusions_00] <- <string> PASSED [ 97%]
test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_string_length_reflection[VARCHAR-_exclusions_01] <- <string> PASSED [100%]

================================================================ short test summary info ================================================================
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[False-MyInline] (call)' : not postgresql and not sqlite and not oracle
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[False-None] (call)' : not postgresql and not sqlite and not oracle
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[False-my_inline] (call)' : not postgresql and not sqlite and not oracle
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[True-MyInline] (call)' : not postgresql and not sqlite and not oracle
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[True-None] (call)' : not postgresql and not sqlite and not oracle
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_inline[True-my_inline] (call)' : not postgresql and not sqlite and not oracle
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_mixed[False] (call)' : not postgresql and not sqlite and not oracle
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_mixed[True] (call)' : not postgresql and not sqlite and not oracle
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_no_constraint[False] (call)' : not postgresql and not sqlite and not oracle and custom function
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_no_constraint[True] (call)' : not postgresql and not sqlite and not oracle and custom function
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[False-MyCkConst] (call)' : not postgresql and not sqlite and not oracle and custom function
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[False-None] (call)' : not postgresql and not sqlite and not oracle and custom function
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[False-my_ck_const] (call)' : not postgresql and not sqlite and not oracle and custom function
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[True-MyCkConst] (call)' : not postgresql and not sqlite and not oracle and custom function
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[True-None] (call)' : not postgresql and not sqlite and not oracle and custom function
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_check_constraint_standalone[True-my_ck_const] (call)' : not postgresql and not sqlite and not oracle and custom function
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_get_foreign_key_options[None-None-RESTRICT-_exclusions_04] (call)' : not postgresql and not sqlite and custom function
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_get_foreign_key_options[None-RESTRICT-None-_exclusions_05] (call)' : not postgresql and not sqlite and custom function
SKIPPED [1] lib/sqlalchemy/testing/config.py:416: 'test/dialect/test_suite.py::ComponentReflectionTestExtra_mssql+pyodbc_15_0_4445_1::test_reflect_expression_based_indexes (call)' : not postgresql and not sqlite >= (3, 9, 0) and not oracle
============================================================ 21 passed, 19 skipped in 0.55s =============================================================

@zzzeek
Copy link
Copy Markdown
Member

zzzeek commented Oct 2, 2025

cool this looks pretty good! you got into the test framework and all that, great. I can take it from here where I do changelog + 2.0 backport

@e2ne0
Copy link
Copy Markdown
Contributor Author

e2ne0 commented Oct 3, 2025

Thanks.
I just fixed the style test issue.
Please let me know if anything else is needed.

@zzzeek zzzeek requested a review from sqla-tester October 3, 2025 02:53
Copy link
Copy Markdown
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision bd9bd43 of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Copy Markdown
Collaborator

New Gerrit review created for change bd9bd43: https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6184

@sqla-tester
Copy link
Copy Markdown
Collaborator

Michael Bayer (zzzeek) wrote:

@CaselIT will add changelog and do backport

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6184

@sqla-tester
Copy link
Copy Markdown
Collaborator

Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6184 has been merged. Congratulations! :)

@sqla-tester
Copy link
Copy Markdown
Collaborator

Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6193 has been merged. Congratulations! :)

sqlalchemy-bot pushed a commit that referenced this pull request Oct 9, 2025
Fixed issue where the index reflection for SQL Server would
not correctly return the order of the column inside an index
when the order of the columns in the index did not match the
order of the columns in the table.
Pull request courtesy of Allen Chen.

Fixes: #12894
Closes: #12895
Pull-request: #12895
Pull-request-sha: bd9bd43

Change-Id: I45ed30bbd0fcfd4f67cb2b682ecb3a18029be2b7
(cherry picked from commit 3dc9720c365a8d03e7c173874db74a080752d24e)
@CaselIT
Copy link
Copy Markdown
Member

CaselIT commented Oct 9, 2025

thanks!

@e2ne0 e2ne0 deleted the fix-mssql-index-column-order branch December 18, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mssql get_indexes() does not preserve column order

4 participants