Quoting Balazs Scheidler <[EMAIL PROTECTED]>:

> Hi,
>
> As it seems we're a bit unlucky at these times. Now I've ran into a
> problem in the FreeTDS driver, we're getting heap corruptions inside
> freetds, and as it seems the root cause is the DBD freetds driver.
>
> More exactly, dbd_freetds seems to have a single state instance, instead
> of allocating a new state for each connection:
>
> typedef struct freedts_type {
>     CS_CONTEXT *ctx;
>     CS_CONNECTION *conn;
>     CS_COMMAND *cmd;
> } FREETDSCON;
> static FREETDSCON freetds;
> ^^^^^^^^^^^^^^^^^^^^^^^^^
>

This is certainly against the idea of being able to create as many  
connections as you need. Afaict no other driver suffers from such a  
limitation.

>
> Does anyone know why this limitation was added to the freetds driver?
>

I'm afraid no. Vadym (who developed the driver) is no longer active as  
he does not seem to work with MS SQL Server anymore, but I'll forward  
your mail to him and see whether he can explain.

> I'm experimenting with the following patch, but still testing it. I'd
> appreciate if you could review it for mistakes I possibly made.
>

Your patch looks good to me although I can't test-drive it.

> BTW: what is the policy about commented out code in
> libdbi/libdbi-drivers source? I personally feel that commented out code
> is not good practice, especially if the code in question is commented
> out without a note stating the exact reason why it was done. For me it
> makes the code harder to read.
>

There is no such thing as a policy right now. If anyone feels like we  
should have a policy, I'll be happy to help finding or writing one.  
There are quite a few things that we could improve, from aesthetic (C  
vs. C++ style comments) to good practice (variable names, comments  
describing the usage and parameter list of functions). I use  
commented-out code mainly for printf() debugging which I personally  
feel is reasonable. I agree that blocks of commented-out code should  
be avoided or at least explained and signed.

regards,
Markus

-- 
Markus Hoenicka
[EMAIL PROTECTED]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libdbi-drivers-devel mailing list
Libdbi-drivers-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel

Reply via email to