Skip to Content.
Sympa Menu

freetds - Re: Reusing CS_COMMAND structures

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Peppler <mpeppler AT peppler.org>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: Reusing CS_COMMAND structures
  • Date: 23 May 2002 08:10:08 -0700

On Wed, 2002-05-22 at 18:43, David Nahman wrote:
> Dear list,
>
> Is it okay to re-use CS_COMMAND structures: i.e.
> allocate them once, and then re-use them after
> ct_results returns something other than CS_SUCCEED?
>
> I ask because I am crashing when I reuse a CS_COMMAND
> structure after a query failes. The program crashes
> at line 340 in ct.c on:
> if (cmd->query) free(cmd->query);
>
>
> Should I be alloc'ing and dropping the structure in
> between each query?

The Sybase version of the libs allow you to allocate a CS_COMMAND object
and reuse it any number of times (that's what the Sybase::CTlib module
does).

So if this fails with FreeTDS it's a bug...

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler AT peppler.org *or* mpeppler AT mbay.net
http://www.mbay.net/~mpeppler
International Sybase User Group: http://www.isug.com

Attachment: signature.asc
Description: This is a digitally signed message part




Archive powered by MHonArc 2.6.24.

Top of Page