Commit 0b66236
committed
fix: output converter lookup by SQL type code, not Python type
_build_converter_map looked up converters using desc[1] (the mapped
Python type, e.g. bytes) but add_output_converter registers by SQL
type code (e.g. -151). Added _column_sql_types to Cursor so the
converter map tries the raw SQL code first, then falls back to
Python type, then WVARCHAR.
Also fixes the output converter test to register by SQL_SS_UDT (-151)
instead of bytes, and adds docstrings to _get_c_type_for_sql_type and
_map_data_type documenting the SQL Server-specific types.1 parent e7a5a3c commit 0b66236
2 files changed
Lines changed: 22 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
| 956 | + | |
956 | 957 | | |
957 | 958 | | |
958 | 959 | | |
| 960 | + | |
959 | 961 | | |
960 | 962 | | |
961 | 963 | | |
| |||
964 | 966 | | |
965 | 967 | | |
966 | 968 | | |
| 969 | + | |
| 970 | + | |
967 | 971 | | |
968 | 972 | | |
969 | 973 | | |
| |||
977 | 981 | | |
978 | 982 | | |
979 | 983 | | |
| 984 | + | |
980 | 985 | | |
981 | 986 | | |
982 | 987 | | |
| |||
992 | 997 | | |
993 | 998 | | |
994 | 999 | | |
| 1000 | + | |
995 | 1001 | | |
996 | | - | |
| 1002 | + | |
997 | 1003 | | |
998 | 1004 | | |
999 | 1005 | | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
1003 | 1018 | | |
1004 | 1019 | | |
1005 | 1020 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
| 308 | + | |
308 | 309 | | |
309 | 310 | | |
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
314 | | - | |
| 315 | + | |
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
| |||
0 commit comments