[freetds] [ freetds-Patches-1045430 ] cursors in ct-lib
ZIGLIO, Frediano, VF-IT
Frediano.Ziglio at vodafone.com
Fri Oct 15 05:43:03 EDT 2004
> > - TDS_CURSOR should be TDSCURSOR for coherence
> > - I don't like "mycursor" variable name. We never used "my" variable
> feel free to change them...
> > - 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
> In TDS 5.0 you can use ct_cursor() to send a "DECLARE CURSOR"
> 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 ?
More information about the FreeTDS