mssql: fall back to base type for alias types during reflection
Fixed regression from version 2.0.42 caused by :ticket:`12654` where the
updated column reflection query would receive SQL Server "type alias" names
for special types such as ``sysname``, whereas previously the base name
would be received (e.g. ``nvarchar`` for ``sysname``), leading to warnings
that such types could not be reflected and resulting in :class:`.NullType`,
rather than the expected :class:`.NVARCHAR` for a type like ``sysname``.
The column reflection query now joins ``sys.types`` a second time to look
up the base type when the user type name is not present in
:attr:`.MSDialect.ischema_names`, and both names are checked in
:attr:`.MSDialect.ischema_names` for a match. Pull request courtesy Carlos
Serrano.
Fixes: #13181
Fixes: #13182
Closes: #13178
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/13178
Pull-request-sha:
be5c3850594665c0154ae215d4f9c322cc5a3f5a
Change-Id: I7fe86b80dfa45b208f7d97003ee5b1df3f07bfe7
(cherry picked from commit
1c78168f8a1a9cd3c88f1977bba1bac763225482)