Skip to Content.
Sympa Menu

freetds - RE: PHP crash on 2nd Select

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Raymond Bero" <rbero AT hostpro.com>
  • To: "'TDS Development Group'" <freetds AT franklin.oit.unc.edu>
  • Subject: RE: PHP crash on 2nd Select
  • Date: Wed, 11 Jul 2001 11:09:03 -0600


I tracked down a couple of core dumps that FreeTDS 0.52 was having. It looks
like the ct_send() call in src/ctlib would pass along a pointer to
tds_submit_query(), but nothing would check whether or not this pointer was
NULL.

The code marked with a '+' was added to deal with the above mentioned
scenerio. Some of the Sybase code was calling ct_send() where
cmd->con->tds_socket=NULL for whatever reason. That should be fine, but
ct_send() needs to check wether tds_socket is valid and return something
accordingly.

The code marked with a '=' was added when I discovered that my BSDI box was
not setting cmd->con->tds_socket=NULL, but instead (cmd ==
cmd->con->tds_socket) !?! Go figure, must have been some kind of compiler
bug, as it was only showing this behavior on my BSDI boxes.

And lastly, I love FreeTDS! You guys have made my job a lot easier. I hope
to help with development in some way in the future. Thanks.


Ray Bero

=================================


CS_RETCODE ct_send(CS_COMMAND *cmd)
{
tdsdump_log(TDS_DBG_FUNC, "%L inside ct_send()\n");

+ if (cmd && cmd->con && !(cmd->con->tds_socket)) {
+ return CS_FAIL;
+ }

= if (cmd == cmd->con->tds_socket) {
= return CS_FAIL;
= }

if (tds_submit_query(cmd->con->tds_socket, cmd->query)==TDS_FAIL)
return CS_FAIL;
else
return CS_SUCCEED;
}





-----Original Message-----
From: Dale Kortum [mailto:dkortum AT mdmgrse.com]
Sent: Wednesday, July 11, 2001 7:29 AM
To: TDS Development Group
Subject: [freetds] PHP crash on 2nd Select


We are using PHP 4.0.6, freetds .52, apache 1.3.20 to connect via ODBC to
MS SQL server. The connect works fine and the first select works great.
As long as we only use 1 select per php script everything is functional.
When we add a second select statement, it immediately crashes with no
output to tdsdump or html. Thanks for any suggestions.

---
You are currently subscribed to freetds as: [rbero AT hostpro.com]
To unsubscribe, forward this message to
$subst('Email.Unsub')





Archive powered by MHonArc 2.6.24.

Top of Page