Releases: mkleehammer/pyodbc
Fixes
This is a primarily a fix patch, thought it does contain one new feature that is turned off by default:
The feature is an optimized Cursor.executemany
that binds parameters into an array to drastically reduce network round trips. This can be a major speedup, but this preliminary version is turned off by default because it can only be used with drivers that use UCS-2 exclusively and that properly deal with the ODBC numeric structure. Right now I would recommend only using this with SQL Server on Windows. This feature will be tweaked in the near future to support as many drivers as possible and to use the configured encodings.
Fixes
- Add a workaround for building on macOS High Sierra.
- Add support for building with homebrew unixODBC
- Fix Unicode error messages that were sometimes garbled in the past.
- Fix Cursor.columns, primaryKeys, and similar metadata methods that would not allow
None
passed in for optional keyword parameters such asCursor.columns('t1', schema=None)
.
Support for subinterpreters and mod_wsgi
This release adds support for subinterpreters, which fixes crashes in systems like mod_wsgi that run multiple Python interpreters in the same process.
Fix Memory Leak
Upgrade ASAP. Previous 4.x versions could cause any parameters passed to SQL statements to live forever by incrementing their reference count.
Possible Python bug workaround
Fix for #206 where Cursor.fetchall() fails due to a possible bug in PyCodec_Encode. Encoding works correctly but it sets an invalid exception which fetchall() detects.
Fix 2.7 Build
Same as 4.0.12, but fix building for Python 2.7
More small fixes: drivers()
The new pyodbc.drivers() implementation buffer was too small, so names would get truncated.
Also fixed a potential double-decrement during import, but did not have a case where it crashed.
Ignore driver-reported max varchar if <=255. Some drivers like FileMaker return -1, etc., which caused a hang when writing.
Add DB/2 XML, homebrew, and pyodbc.drivers()
Added support for reading IBM DB/2 columns as Unicode text.
Merged in pull request that adds a localhost homebrew directory to the include paths on macOS. Thanks @sgivens0
Merged in a long-neglected pull request that adds pyodbc.drivers(). Thanks @sergiodlc
Add support for UUID
Accept UUID objects as parameters. If pyodbc.native_uuid is True, return SQL_GUID columns
as UUID objects. If False, the default for backwards compatibility, return them as Unicode
strings.
MS Access Python 3 support and optimized ints
Issue #84 Previously all Python 3 longs were sent via SQL_BIGINT but Access does not support this so now SQL_INTEGER is used when possible. This is also a nice optimization for other drivers.
Also fixed #195 - Python 3 text and Python 2 unicode was always passed as SQL_WVARCHAR even if the encoding was set to something like UTF-8 that should be SQL_VARCHAR.
Update for Teradata
Recently a change was made to use SQLDescribeColW so that Unicode column names could be retrieved properly. Unfortunately this uncovered some weirdness with some drivers, this time Teradata.
I'm not sure if the issue is iODBC (which Apple doesn't ship anymore) is using a 4-byte
SQLWCHAR or if Teradata is returning UCS4/UTF-32LE for column names in SQLDescribeColW. Either
way I've added a hack that assumes 4-byte chars if the decoding for SQL_WMETADATA (a pyodbc
specific constant) is set to any of the UTF-32 encodings. The encoding is then actually used.
cnxn.setdecoding(pyodbc.SQL_WMETADATA, encoding='utf-32le')
Fixes #194