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.
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.
Reworked Unicode support, properly differentiating between SQLWCHAR on the different platforms. This should fix a lot of the OS/X problems and perhaps Linux UCS4 build problems. Version format now includes the branch name if not 'master' or v<version>, allowing custom builds to be identified, such as v2unicode-2.1.8-beta03. Also tested with 64-bit Windows builds, so more Py_ssize_t warnings were found and corrected. Created TRACE macro to replace the #ifdefs sprinkled through the code.
Updated calculation of buffer size needed for binding decimals. This shouldn't have any affect other than assertions - generally the old calculation added an extra character or two. The previous varchar/longvarchar fix used varchar max with Unicode instead of wvarchar. Also updated unit tests.
As reported by Andy Hochhaus in the pyodbc group, SQL Server fails if you compare a SQL_LONGVARCHAR parameter with a varchar field. Had been using a hardcoded 255 to determine when to switch from VARCHAR to LONGVARCHAR. Now uses SQLGetTypeInfo to determine the maximum varchar and binary widths. This will also help performance for programs that bind a lot of strings greater than 255 but less than their db's max varchar size.
Crash due to using HSTMT while cleaning up parameters after the connection is closed. Unfortunately I wasn't able to put together an easy test case without using the with statement like the reporter did.
SQL Server 2008 doesn't allow SQLDescribeParam calls once parameters have been bound. This error caused the varchar default to be used instead of raising an error, which works for all columns except binary. SS won't convert char to binary automatically. Fix is to call describe for all NULL parameters before binding. Added test_none_param to SQL Server unit tests.
…ne/NULL) Performance work for Joe Salmeri, a great pyodbc user (and tester). Unfortunately we now don't know when a column is a BIT column, so we can't convert all objects to bools. This was never documented and doesn't seem like a big deal since all numeric values should still work normally.
…tion info. The connection info is in preparation for querying even more info per connection to implement Cursor.call Fixed the setup.py file so it doesn't build a debug library all the time. You can add --assert and --trace to turn those on instead of modifying pyodbc.h. Also added a license file (feature request).