Skip to Content.
Sympa Menu

freetds - Re: re-use of dbprocess structure (was: Re: [freetds] state of dbrpcsend())

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: liam AT inodes.org
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: re-use of dbprocess structure (was: Re: [freetds] state of dbrpcsend())
  • Date: Thu, 15 Jul 2004 15:38:30 +1000

On Thu, Jul 08, 2004 at 11:50:58AM +0200, Frediano Ziglio wrote:

> This patch should fix the problem (committed in 0.63, not in 0.62)

Unfortunately, that patch also introduces a bug where stored procedures
with no arguments/paramaters can not be executed. The check to
ensure malloc() has succeeded catches the case where param_info_alloc()
correctly does to return anything.

Here is a patch that fixes the issue.

--- rpc.c 2004-06-14 09:43:36.000000000 +1000
+++ rpc.c 2004-07-15 15:23:10.000000000 +1000
@@ -239,10 +239,22 @@

for (rpc = dbproc->rpc; rpc != NULL; rpc = rpc->next) {
int erc;
- TDSPARAMINFO *pparam_info =
param_info_alloc(dbproc->tds_socket, rpc);
+ TDSPARAMINFO *pparam_info = NULL;
+
+ /* liam AT inodes.org: allow stored procedures to have no
+ * paramaters
+ */
+ if (rpc->param_list != NULL) {
+ pparam_info = param_info_alloc(dbproc->tds_socket,
rpc);
+ if (!pparam_info)
+ return FAIL;
+ }
+
+ erc = tds_submit_rpc(dbproc->tds_socket,
+ dbproc->rpc->name, pparam_info);
+
+ tds_free_param_results(pparam_info);

- erc = tds_submit_rpc(dbproc->tds_socket, dbproc->rpc->name,
pparam_info);
- ;

Can this be commited to CVS please.

I suspect the source distribution needs some more comprehensive RPC unit
tests. Unless there are any objections, I will write some.

Cheers.




Archive powered by MHonArc 2.6.24.

Top of Page