Removed deprecated Row_slice. The sequence structure changed this from an actual function pointer to a void pointer. GCC 4.6.2 would not allow the assignment of Row_slice to void*. This may not build under 2.5. Also eliminated a bunch of casts to see if newer GCC would uncover other issues.
MakeConnectionString assumed that values were already converted to Unicode, but this was not the case. Added TextCopyToUnicode to contain the difference which cleans the code up nicely. Discovered while trying to reproduce Issue 223.
Many thanks to davidp.r...@gmail.com for finding this.
…xecute. The saved prepared statement was not cleaned up when a SQLTables or similar function was used. If the next execute used the same SQL, pyodbc did not call SQLPrepare.
The provided fix suggestion looks correct and I can see how it would crash, but was unable to reproduce with the unit test. Probably related to Microsoft vs. FreeTDS differences.
The issue was actually in the ODBC driver, which has been fixed in version 0.91 of the driver. There are a couple of issues left, but I'll need to work through them with the driver author: reading a zero-byte blob and reading text values in 2 passes.
Issue and patch (!) from firstname.lastname@example.org. Thanks.
Fixed issue 91 - handling of decimals was incorrect (off by 1). Added lots of SQL Server unit tests. To properly fix this, reworked and simplified parameter binding. Instead of separating the memory requirement and the actual memory preparation, it is now performed in 1 step and stored in the new ParamInfo structures. I added a lot of optional malloc calls (not usually used), so I added a PYODBC_LEAK_CHECK parameter which causes pyodbc_malloc and pyodbc_free to track allocations. This is not thread safe and is intended only for troubleshooting.