Last active
December 22, 2015 16:39
-
-
Save msabramo/6501240 to your computer and use it in GitHub Desktop.
2013-09-09 - Patch for pymssql 1.0.2 to make it work with newer versions of FreeTDS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mssqldbmodule.c b/mssqldbmodule.c | |
index 151bc2c..7081715 100644 | |
--- a/mssqldbmodule.c | |
+++ b/mssqldbmodule.c | |
@@ -1934,12 +1934,12 @@ PyObject *get_result(_mssql_connection *conn) { | |
// find a result set that has at least one column | |
conn->last_dbresults = SUCCEED; | |
- while (conn->last_dbresults == SUCCEED && | |
- (conn->num_columns = dbnumcols(conn->dbproc)) <= 0) { | |
+ do { | |
Py_BEGIN_ALLOW_THREADS | |
conn->last_dbresults = dbresults(conn->dbproc); | |
Py_END_ALLOW_THREADS | |
- } | |
+ } while (conn->last_dbresults == SUCCEED && | |
+ (conn->num_columns = dbnumcols(conn->dbproc)) <= 0); | |
check_cancel_and_raise(conn->last_dbresults, conn); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment