Skip to Content.
Sympa Menu

freetds - RE: [freetds] [ freetds-Patches-1045430 ] cursors in ct-lib

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] [ freetds-Patches-1045430 ] cursors in ct-lib
  • Date: Fri, 15 Oct 2004 11:43:03 +0200

> > - TDS_CURSOR should be TDSCURSOR for coherence
> > - I don't like "mycursor" variable name. We never used "my" variable
> prefix
>
> feel free to change them...
>

Changed

>
> > - I don't understand the reason for client_cursor_id and
> cursor_id.Isn't one of them sufficient?
>
> Briefly, no. its to do with the ct_library functions and the TDS 5.0
> protocol
>
> In TDS 5.0 you can use ct_cursor() to send a "DECLARE CURSOR"
> directive,
> which will return a real (server) cursor_id, which you can then use as
> an input to a subsequent directive, e.g. "OPEN CURSOR"
>
> In TDS 7.0 there is no concept of a DECLARE CURSOR directive,
> so we have
> to give back to the calling program a "dummy" cursor_id which it can
> then use in subsequent ct_cursor() calls.

Why not using server id in TDS 5.0 and use a dummy id for TDS 7.0 ?

> > there are many place where you search for cursor using
> > client_cursor_id it would better to use a function. This code it's
> > mainly located in token.c, I think that somewhere we should set
> > current_results before token processings, use this variable
> and don't
> > care about cursor_id (Bill, the weird thing it's that you
> explain this
> > some time ago :) ).
>
> You are right, there's a lot of similar code hanging around.
> It'll take a little bit of thinking to get it elegant, though.
>

I changed the loops, mainly cause you forgot to test for cursor != NULL.
I don't like tds->client_cursor_id setting in ct.c, IMHO should be set
only inside libTDS.

> I should make the effort to understand the "dynamic" code some more.
> It seems to be
> a) involved with many things that people try to do with ODBC driver
> b) the only substantial unknown in the ct-lib code (to me anyway)
>

It supported by ctlib too, not only ODBC (although better supported and
tested in ODBC).

This morning I finished by tests with HP-UX 11. It compile and run (even
all tests ODBC included) without problems (I only removed some warnings
due to sizeof returning unsigned long int instead of unsigned int).
Does current CVS (or today snapshot) work correctly under Solaris ?

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page