Closed jabbera closed 8 months ago
Not all drivers support ODBC 3.8, but it does seem like a good idea to make this configurable.
I think each connection can have its own environment, which means its own odbc version. That seems like a major change versus allowing the default to be optionally 3.8. Considering 3.8 came out in 2009 all or nothing might be fine.
When connection pooling is on in unixodbc there is a connection reset procedure that needs to be run: https://github.com/lurcher/unixODBC/blob/9b31cd228d01e768a7ad9126d5da8860f1ed72a9/DriverManager/SQLConnect.c#L3904 Not running this causes connections in the pool to be left tainted will all sorts of badness such as the following not being done:
This feature is only enabled if the environment is set to 3.8 or higher. In pyodbc it's hard coded to 3.X which doesn't include this vital behavior. https://github.com/mkleehammer/pyodbc/blob/ee0ad21e7ab00c4ab974f332ab0ce22bb7ad776d/src/pyodbcmodule.cpp#L299
I'm happy to author a PR to enable this if it's something you would be open to.