From: Ludek Finstrle <luf@pzkagis.cz>
To: Andrus <eetasoft@online.ee>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Access violation C5 error on Visual FoxPro SQLEXEC() call after error
Date: Fri, 16 Dec 2005 18:35:34 +0100
Message-ID: <20051216173534.GC22756@soptik.pzkagis.cz> (raw)
In-Reply-To: <20051216133743.GD20814@soptik.pzkagis.cz>
References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4E7E9DE@ratbert.vale-housing.co.uk>
<dnrkko$2vdh$1@news.hub.org>
<20051216133743.GD20814@soptik.pzkagis.cz>
> > Can we find a way to implement this in pgodbc also ?
>
> I have one solution in my mind and Hiroshi Inoue point me that the code
> is close ready. I'll try it over weekend.
I think I found the solution. I remove Dave's patch and this solution
works with first Andrus repro app. So I hope it's good enough.
I sent it in another thread. I don't know if Hiroshi is monitoring
all posts.
Please review and comment attached patch.
Thanks to Hiroshi for kicking me
Luf
Attachments:psqlodbc-limit_bind_param.diff (text/plain, 1.4K) download
diff -c psqlodbc.orig\execute.c psqlodbc\execute.c
*** psqlodbc.orig\execute.c Tue Dec 06 21:53:30 2005
--- psqlodbc\execute.c Fri Dec 16 18:11:16 2005
***************
*** 542,547 ****
--- 542,548 ----
UInt4 offset = apdopts->param_offset_ptr ? *apdopts->param_offset_ptr : 0;
Int4 bind_size = apdopts->param_bind_type;
Int4 current_row = stmt->exec_current_row < 0 ? 0 : stmt->exec_current_row;
+ SWORD param_count;
/*
* Increment the number of currently processed rows
***************
*** 549,555 ****
if (ipdopts->param_processed_ptr)
(*ipdopts->param_processed_ptr)++;
stmt->data_at_exec = -1;
! for (i = 0; i < apdopts->allocated; i++)
{
Int4 *pcVal = apdopts->parameters[i].used;
--- 550,559 ----
if (ipdopts->param_processed_ptr)
(*ipdopts->param_processed_ptr)++;
stmt->data_at_exec = -1;
! /* Check bind parameters count */
! if (SQL_SUCCESS != PGAPI_NumParams(stmt, ¶m_count))
! return SQL_ERROR;
! for (i = 0; i < param_count; i++)
{
Int4 *pcVal = apdopts->parameters[i].used;
***************
*** 740,750 ****
}
/* In the middle of SQLParamData/SQLPutData, so cancel that. */
- - /* Free all previous data-at-exec buffers */- mylog("%s: Clearing parameters et al.\n", func);- - SC_free_params(stmt, STMT_FREE_PARAMS_ALL);
stmt->data_at_exec = -1;
stmt->current_exec_param = -1;
stmt->put_data = FALSE;
--- 744,749 ----
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: luf@pzkagis.cz, eetasoft@online.ee
Subject: Re: Access violation C5 error on Visual FoxPro SQLEXEC() call after error
In-Reply-To: <20051216173534.GC22756@soptik.pzkagis.cz>
References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4E7E9DE@ratbert.vale-housing.co.uk> <dnrkko$2vdh$1@news.hub.org> <20051216133743.GD20814@soptik.pzkagis.cz> <20051216173534.GC22756@soptik.pzkagis.cz>
* 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