Diagnostic messages (e.g. SQL error messages) are retrieved after executing a SQL query. However, the diagnostic messages were being retrieved only for a return value of SQL_SUCCESS_WITH_INFO. This should be extended for other return values.
Function GetDiagRecs has been changed to add diagnostic messages to the "messages" cursor attribute rather than replace the attribute. Deciding when to clear the "messages" attribute should happen outside GetDiagRecs.
Diagnostic messages (e.g. SQL error messages) are retrieved after executing a SQL query. However, the diagnostic messages were being retrieved only for a return value of SQL_SUCCESS_WITH_INFO. This should be extended for other return values.
Function GetDiagRecs has been changed to add diagnostic messages to the "messages" cursor attribute rather than replace the attribute. Deciding when to clear the "messages" attribute should happen outside GetDiagRecs.
Fixes #1238 .
Note, Github Actions no longer supports Python 2.7.
Ref: https://learn.microsoft.com/en-us/sql/odbc/reference/develop-app/return-codes-odbc https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlexecdirect-function?view=sql-server-ver16#returns https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlmoreresults-function?view=sql-server-ver16#returns