From c61e1bcf9ac16817b62111b4991a729dad3c2749 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Fri, 11 Nov 2011 22:52:01 +0000 Subject: [PATCH] Before dropping the statement, sync and discard the response from the server for the pending extended query. --- statement.c | 8 ++++++++ version.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/statement.c b/statement.c index 715cde2..5caeefb 100644 --- a/statement.c +++ b/statement.c @@ -252,6 +252,14 @@ PGAPI_FreeStmt(HSTMT hstmt, SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Statement is currently executing a transaction.", func); return SQL_ERROR; /* stmt may be executing a transaction */ } + /* + * Before dropping the statement, sync and discard + * the response from the server for the pending + * extended query. + */ + if (NULL != conn->sock && stmt == conn->stmt_in_extquery) + QR_Destructor(SendSyncAndReceive(stmt, NULL, "finish the pending query")); + conn->stmt_in_extquery = NULL; /* for safety */ /* * Free any cursors and discard any result info. * Don't detach the statement from the connection diff --git a/version.h b/version.h index ac2030d..4cdcff8 100644 --- a/version.h +++ b/version.h @@ -12,6 +12,6 @@ #define POSTGRESDRIVERVERSION "09.00.0311" #define POSTGRES_RESOURCE_VERSION "09.00.0311\0" #define PG_DRVFILE_VERSION 9,0,03,11 -#define PG_BUILD_VERSION "201111110001" +#define PG_BUILD_VERSION "201111120001" #endif -- 2.39.5