aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/odbc/execute.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/odbc/execute.c')
-rw-r--r--src/interfaces/odbc/execute.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/interfaces/odbc/execute.c b/src/interfaces/odbc/execute.c
index 11893321f84..14ed086e83a 100644
--- a/src/interfaces/odbc/execute.c
+++ b/src/interfaces/odbc/execute.c
@@ -573,6 +573,7 @@ PGAPI_Cancel(
{
static char *func = "PGAPI_Cancel";
StatementClass *stmt = (StatementClass *) hstmt;
+ ConnectionClass *conn;
RETCODE result;
ConnInfo *ci;
@@ -589,7 +590,8 @@ PGAPI_Cancel(
SC_log_error(func, "", NULL);
return SQL_INVALID_HANDLE;
}
- ci = &(SC_get_conn(stmt)->connInfo);
+ conn = SC_get_conn(stmt);
+ ci = &(conn->connInfo);
/*
* Not in the middle of SQLParamData/SQLPutData so cancel like a
@@ -598,6 +600,11 @@ PGAPI_Cancel(
if (stmt->data_at_exec < 0)
{
/*
+ * Tell the Backend that we're cancelling this request
+ */
+ if (stmt->status == STMT_EXECUTING)
+ CC_send_cancel_request(conn);
+ /*
* MAJOR HACK for Windows to reset the driver manager's cursor
* state: Because of what seems like a bug in the Odbc driver
* manager, SQLCancel does not act like a SQLFreeStmt(CLOSE), as