pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Inoue, Hiroshi <inoue@tpf.co.jp>
To: Jade Koskela <jkoskela0@gmail.com>
Cc: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: crash bug on closed connection
Date: Thu, 16 Oct 2014 08:59:12 +0900
Message-ID: <543F0A50.4040106@tpf.co.jp> (raw )
In-Reply-To: <543EC9BA.1020901@tpf.co.jp >
References: <CAN5ZvqwcKmV7AoevuWJPfrN=rsqSzwDKRKXWhMPmCineggA_3Q@mail.gmail.com >
<CAN5Zvqy6hsTBg2KcmA1zk1c+vvMNRmaJ5rRLTiBKoYSC=59HRA@mail.gmail.com >
<CAN5ZvqzAi67VOnSXGtownVY57w-XPJxeBA4Q+BWfPTJVmQPRQw@mail.gmail.com >
<CAN5ZvqyRro-wHxZoam=MoZh9Aa+0uwJ84bsOXKXb0jz8CyJqaA@mail.gmail.com >
<CAN5ZvqwLXs3z0pxAQOKDthLBdRkP_Md+bryiexdtAHtp0rFBng@mail.gmail.com >
<543EC9BA.1020901@tpf.co.jp >
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
(2014/10/16 4:23), Inoue, Hiroshi wrote:
> Hi Jade,
>
> Could you please try the attached patch?
Oops the patch seems to contain *color* attributes.
Pleaae try the attached patch for this mail instead.
regards,
Hiroshi Inoue
--
I am using the free version of SPAMfighter.
SPAMfighter has removed 12760 of my spam emails to date.
Get the free SPAMfighter here: http://www.spamfighter.com/len
Do you have a slow PC? Try a Free scan
http://www.spamfighter.com/SLOW-PCfighter?cid=sigen
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Attachments:
fix_a_crash.patch (text/x-patch, 2.7K) download
diff --git a/connection.c b/connection.c
index af985f2..7f73296 100644
--- a/connection.c
+++ b/connection.c
@@ -2808,6 +2808,7 @@ CC_send_query_append(ConnectionClass *self, const char *query, QueryInfo *qi, UD
int maxlen,
empty_reqs;
BOOL ReadyToReturn = FALSE,
+ retDetermined = FALSE,
query_completed = FALSE,
beforeV2 = !(PROTOCOL_64(&self->connInfo) || PROTOCOL_74(&self->connInfo)),
aborted = FALSE,
@@ -3246,6 +3247,7 @@ inolog("Discarded the first SAVEPOINT\n");
else
retres = cmdres;
aborted = TRUE;
+ retDetermined = TRUE;
}
query_completed = TRUE;
}
@@ -3389,17 +3391,28 @@ mylog("!!! copydata len=%d\n", response_length);
cleanup:
if (SOCK_get_errcode(self->sock) != 0)
- {
- if (0 == CC_get_errornumber(self))
- CC_set_error(self, CONNECTION_COMMUNICATION_ERROR, "Communication error while sending query", func);
kill_conn = TRUE;
- }
if (kill_conn)
- {
CC_on_abort(self, CONN_DEAD);
+
+ if (CONN_DOWN == self->status)
+ {
+ if (0 == CC_get_errornumber(self))
+ CC_set_error(self, CONNECTION_COMMUNICATION_ERROR, "Communication error while sending query", func);
retres = NULL;
+ aborted = TRUE;
}
- if (rollback_on_error && CC_is_in_trans(self) && !discard_next_savepoint)
+ /*
+ * Break before being ready to return.
+ */
+ else if (!ReadyToReturn &&
+ !retDetermined)
+ retres = cmdres;
+ /* Issue rollback command if necessary */
+ if (CONN_CONNECTED == self->status &&
+ rollback_on_error &&
+ CC_is_in_trans(self) &&
+ !discard_next_savepoint)
{
char cmd[64];
@@ -3421,12 +3434,6 @@ cleanup:
CLEANUP_FUNC_CONN_CS(func_cs_count, self);
#undef return
/*
- * Break before being ready to return.
- */
- if (!ReadyToReturn)
- retres = cmdres;
-
- /*
* Cleanup garbage results before returning.
*/
if (cmdres && retres != cmdres && !used_passed_result_object)
diff --git a/statement.c b/statement.c
index da5abf5..98faadf 100644
--- a/statement.c
+++ b/statement.c
@@ -2077,12 +2077,17 @@ inolog("get_Result=%p %p %d\n", res, SC_get_Result(self), self->curr_param_resul
*/
if (appendq)
{
- QResultClass *qres, *nres;
+ QResultClass *qres, *pres, *nres;
- for (qres = res; qres;)
+ for (qres = res, pres = NULL; qres;)
{
if (qres->command && strnicmp(qres->command, fetch_cmd, 5) == 0)
{
+ if (NULL != pres)
+ {
+ pres->next = NULL;
+ QR_Destructor(res);
+ }
res = qres;
break;
}
@@ -2096,8 +2101,7 @@ inolog("get_Result=%p %p %d\n", res, SC_get_Result(self), self->curr_param_resul
}
QR_add_notice(nres, QR_get_notice(qres));
}
- qres->next = NULL;
- QR_Destructor(qres);
+ pres = qres;
qres = nres;
}
}
view thread (9+ messages) latest in thread
Message-ID: <543F0A50.4040106@tpf.co.jp>
Permalink: ../543F0A50.4040106@tpf.co.jp/
Also on: postgresql.org/message-id/543F0A50.4040106@tpf.co.jp
copy link · copy postgr.es · copy git am
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: inoue@tpf.co.jp, jkoskela0@gmail.com
Subject: Re: crash bug on closed connection
In-Reply-To: <543F0A50.4040106@tpf.co.jp>
References: <CAN5ZvqwcKmV7AoevuWJPfrN=rsqSzwDKRKXWhMPmCineggA_3Q@mail.gmail.com> <CAN5Zvqy6hsTBg2KcmA1zk1c+vvMNRmaJ5rRLTiBKoYSC=59HRA@mail.gmail.com> <CAN5ZvqzAi67VOnSXGtownVY57w-XPJxeBA4Q+BWfPTJVmQPRQw@mail.gmail.com> <CAN5ZvqyRro-wHxZoam=MoZh9Aa+0uwJ84bsOXKXb0jz8CyJqaA@mail.gmail.com> <CAN5ZvqwLXs3z0pxAQOKDthLBdRkP_Md+bryiexdtAHtp0rFBng@mail.gmail.com> <543EC9BA.1020901@tpf.co.jp> <543F0A50.4040106@tpf.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox