From: Hiroshi Inoue <inoue@tpf.co.jp>
To: lev.bukovski@teliasonera.com
To: pgsql-odbc@postgresql.org
Subject: Re: Prepared statement error with UseServerSidePrepare=1
Date: Tue, 03 Jun 2014 00:16:51 +0900
Message-ID: <538C9563.7020401@tpf.co.jp> (raw)
In-Reply-To: <619ABD714EEDD84E8E582E993559DB36142AFEB6@EXMB12TSTRZ2.tcad.telia.se>
References: <619ABD714EEDD84E8E582E993559DB36142ADA8C@EXMB12TSTRZ2.tcad.telia.se>
<538BF6A0.1020404@tpf.co.jp>
<619ABD714EEDD84E8E582E993559DB36142AFEB6@EXMB12TSTRZ2.tcad.telia.se>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
(2014/06/02 22:11), lev.bukovski@teliasonera.com wrote:
> Hi Hiroshi,
>
> I applied your patch on psqlodbc 9.3.3 (NOT on the head branch).
> Now I can't even get to insert operations, because I get error while application configuration fetch.
>
> I have this CONFIG table, from where I load configuration parameters (SELECT VALUE2, VALUE3 FROM CONFIG WHERE VALUE1 = ?)
> Each execute of the SQL returns one row. So the first execute success, but second returns with 'Null statement result in PGAPI_ExtendedFetch' error.
>
> psqlodbc and mylog files are in attechaments.
Thanks for the report.
Please apply the attached patch also.
It's the same as the one attached in the thread
[ODBC] Problems using SQLFetch on prepared INSERT with RETURNING clause
.
regards,
Hiroshi Inoue
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbcAttachments:insertreturning_twice.patch (text/x-patch, 554B) downloaddiff --git a/statement.c b/statement.cindex 0aa31ce..4bbf132 100644--- a/statement.c+++ b/statement.c@@ -317,6 +317,7 @@ PGAPI_FreeStmt(HSTMT hstmt,
{
return SQL_ERROR;
}
+ SC_set_Curres(stmt, NULL);
}
else if (fOption == SQL_RESET_PARAMS)
SC_free_params(stmt, STMT_FREE_PARAMS_ALL);
@@ -2260,6 +2261,8 @@ inolog("res->next=%p\n", tres);
last->next = res;
self->curr_param_result = 1;
}
+ if (NULL == SC_get_Curres(self))+ SC_set_Curres(self, SC_get_Result(self));
ipdopts = SC_get_IPDF(self);
has_out_para = FALSE;
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, lev.bukovski@teliasonera.com
Subject: Re: Prepared statement error with UseServerSidePrepare=1
In-Reply-To: <538C9563.7020401@tpf.co.jp>
References: <619ABD714EEDD84E8E582E993559DB36142ADA8C@EXMB12TSTRZ2.tcad.telia.se> <538BF6A0.1020404@tpf.co.jp> <619ABD714EEDD84E8E582E993559DB36142AFEB6@EXMB12TSTRZ2.tcad.telia.se> <538C9563.7020401@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