ReleaseMicrosoftMicrosoftpublished Dec 19, 2025seen Jun 26

microsoft/mssql-python v1.1.0

microsoft/mssql-python

Open original ↗

Captured source

source ↗
published Dec 19, 2025seen Jun 26captured 1whttp 200method plain

v1.1.0

Repository: microsoft/mssql-python

Tag: v1.1.0

Published: 2025-12-19T12:50:45Z

Prerelease: no

Release notes:

Release Notes - Version 1.1.0

Enhancements

  • Thread-Safe Encoding/Decoding (#342)

_What changed_: Introduced re-entrant lock to protect encoding and decoding settings across all connection methods (setencoding, setdecoding, getencoding, getdecoding). Enforced strict validation allowing only utf-16le and utf-16be for SQL_WCHAR types, explicitly rejecting utf-16 with BOM due to byte order ambiguity. Added security validation to ensure encoding names contain only safe characters and reasonable lengths. _Who benefits_: Multi-threaded applications with concurrent connections, applications processing Unicode data from SQL Server, security-conscious deployments preventing encoding-based attacks _Impact_: Prevents race conditions in encoding/decoding configuration, eliminates encoding-related data corruption in concurrent scenarios, and blocks potential denial-of-service attacks through malicious encoding specifications > Fixes #250

  • Comprehensive Linting and Code Quality (#331)

_What changed_: Added GitHub Actions workflow for automated Python (flake8) and C++ (clang-format) linting. Introduced .flake8 and updated .clang-format configuration files. Applied comprehensive formatting to all Python and C++ files following project style guidelines. _Who benefits_: All contributors, code reviewers, maintainers ensuring consistent code quality _Impact_: Enforces consistent code style across the codebase, catches style violations early in CI, improves code readability and maintainability. > Fixes #22

Bug Fixes

  • Segmentation Fault on Linux During Garbage Collection (#361)

_What changed_: Fixed critical double-free issue in SqlHandle::free() by preventing handle cleanup during Python interpreter shutdown for both statement (SQL_HANDLE_STMT) and database connection (SQL_HANDLE_DBC) handles _Who benefits_: All Linux users, long-running applications with frequent connection cycles, applications experiencing crashes during shutdown _Impact_: Eliminates segmentation faults during Python garbage collection, improves application stability and reliability on Linux platforms > Fixes #341

  • Connection Pooling Isolation Level Leak (#343)

_What changed_: Transaction isolation level now explicitly reset to READ COMMITTED when pooled connections are reused. Added logic to Connection::reset() method to prevent isolation level settings from leaking between connection usages, addressing limitation of SQL_ATTR_RESET_CONNECTION which does not reset isolation level. _Who benefits_: Applications using connection pooling with different isolation level requirements, multi-tenant applications sharing connection pools, systems requiring predictable transaction isolation behavior _Impact_: Prevents unexpected transaction behavior from inherited isolation levels, ensures consistent database state across pooled connection reuse, eliminates hard-to-debug isolation level conflicts > Fixes #337

  • UTF-16 String Decoding from SQL Server (#340)

_What changed_: Enhanced getinfo()method to properly decode UTF-16LE strings from SQL Server with fallback to UTF-8 encoding. Added comprehensive test coverage for string encoding validation. _Who benefits_: Applications retrieving driver or connection metadata, systems processing non-ASCII characters in connection info, developers troubleshooting encoding issues _Impact_: Eliminates data corruption when retrieving string metadata from SQL Server, ensures proper character encoding across all platforms, prevents silent encoding failures > Fixes #318

  • Improved UTF-16/UTF-32 Conversion Performance (#365)

_What changed_: Replaced deprecated std::wstring_convert with optimized direct UTF-16 to UTF-32 conversion. Implemented explicit surrogate pair handling, removed intermediate buffers, and streamlined conversion logic for better performance and branch prediction. Added robust handling for invalid surrogate pairs and code points. _Who benefits_: All macOS/Linux users processing Unicode data, applications handling characters outside Basic Multilingual Plane (BMP), performance-sensitive workloads _Impact_: Greater than 10x performance improvement for UTF-8/16 conversions, eliminates deprecation warnings from modern compilers, improves robustness with malformed Unicode input

  • Connection String Escaping Rules (#364)

_What changed_: Fixed parser and builder to correctly handle ODBC connection string curly brace escaping rules. Only closing braces inside curlies require escaping (e.g., {pw}}d} for literal pw}d). Opening braces don't require escaping when wrapped in curlies. _Who benefits_: Users with special characters in passwords or connection string values, applications migrating from other database drivers, developers troubleshooting connection string issues _Impact_: Enables correct handling of passwords and values containing curly braces, aligns with official ODBC specification (MS-ODBCSTR), prevents connection failures due to incorrect escaping > Fixes #363

  • IntegrityError Detection with OUTPUT Clause (#338)

_What changed_: Fixed error handling in fetchall() method to properly check and handle errors from DDBCSQLFetchAll. Added explicit check_error call after fetch operation. _Who benefits_: Applications using INSERT statements with OUTPUT clause and multiple VALUES entries, developers expecting proper IntegrityError exceptions on constraint violations _Impact_: Ensures errors are properly detected and raised during batch inserts with OUTPUT clause, improves error handling reliability and debugging experience > Fixes #333

  • Query Timeout During Cursor Creation (#348)

_What changed_: Refactored timeout handling by introducing _set_timeout() method to set query timeout attribute during cursor initialization rather than on each execute() call. Centralizes timeout management in cursor lifecycle following performance best practices. _Who benefits_: Applications with strict query timeout requirements, performance-sensitive workloads executing many queries, developers experiencing timeout-related issues _Impact_: Improves consistency of timeout application, reduces overhead by setting timeout once during cursor creation, ensures timeout is active for entire...

Excerpt shown — open the source for the full document.