Tags: BdDsl/pyodbc
Tags
Add constants for setting transaction isolation level (mkleehammer#286)
Fix PyArg_ParseTupleAndKeywords calls that accept optional strings. A lot of the keywords in Cursor methods are optional, but I incorrectly used 's' in the format string. This meant you could call the function without passing them, but would fail if you passed None for them, which is not what I intended. It has not been noticed in normal usage because it is easier to call `f('t1')` than `f('t1', schema=None, catalog=None)`. However, when you use a wrapper, like aioodbc does, it will fail: def wrapper(table, schema=None, catalog=None): call(cursor.columns, table, schema=schema, catalog=catalog) def call(func, *args, **kwargs): func(*args, **kwargs) At this point, kwargs is {schema:None, catalog:None} and now we're passing None explicitly. The solution, of course, is to use 'z' instead. Note that I have only corrected Cursor methods. I only wrote a test for Cursor.columns in SQL Server Python 3 and PostgreSQL Python 3. This bug is in pyodbc before any database calls are made so it is database-independent.
Fix datetime precision causing milliseconds to not be read. The datetime precision was no longer being read so the default was used. This caused it to read only up to seconds. I had consolidated some code while fixing something else and missed an important "if" statement that was specific to one of the instances. Fixes mkleehammer#235
PreviousNext