ID: 5323
Updated by: joey
Old-Status: Analyzed
Status: Duplicate
Bug Type: Sybase (dblib) related
Operating system: 
PHP Version: 4.0.1pl2
Assigned To: 

This has now become #5684

Previous Comments:

[2000-07-27 22:22:23] [EMAIL PROTECTED]
I've switched to CT-Lib; data corruption is gone, BUT... the call to ct_con_alloc() 
fails frequently... in ext/php_sybase_ct.c, the line that reads:

if(ct_con_alloc(...) != CS_SUCCEED) {
   phperror(E_WARNING, "Unable to allocate connection record...");

~(not a verbatim description)~

Is getting executed.  I can't get php, sybase, or linux to give me any more 
information...  Perhaps CT-Lib has verbose error reporting that I could build in right 


[2000-07-27 20:19:02] [EMAIL PROTECTED]
awaiting feedback since 07-04


[2000-07-04 22:04:30] [EMAIL PROTECTED]
There have been some changes to the DB-Lib in recent CVS.
DB-Lib has been very unreliable since 4.0 beta 1, but Zeev
is trying to fix it. Can you try the CVS and see if it works?

Reason(s) to use CT-Lib instead of DB-Lib:

1) DB-Lib is no longer supported by Sybase and will eventually
go away.

2) DB-Lib does not have, for example, sybase_num_rows(). You
have to do a second query ("select count(*)") to get this information.

3) The error messages in CT-Lib are more configurable. You can turn
down the min_severity_level with sybase.min_message_severity and
friends in your php.ini. This will make the warnings go away, while still
letting you see the stuff that you need to.


[2000-07-02 01:20:14] [EMAIL PROTECTED]
The following code snippet is used in an abstract db class in an application I am 

$query=sybase_query("<SQL QUERY HERE>");
while($row=sybase_fetch_array($query)) {
      if(is_int($key)) unset($row[$key]);

return $result;

The code is used to get rid of [via unset()] the numeric keys in the array that 
syabse_fetch_array() returns.  When executed, the Apache server dies from a seg fault.

gdb reports different error messages spuriously:
segfault - 0x40082501 in __kill () from /lib/
segfault - 0x???????? in ?????? () from /opt/sybase-11.9.2/

If the line containing "unset()" is removed, the crash does not occur (sometimes there 
is no crash, only garbled data).  

If PHP is compiled with the Sybase-CT library instead, then the code works fine 
(unchanged), but this is unoptimal since then warnings are generated by selecting the 
database with sybase_connect() or sybase_select_db().

Please e-mail me if there is a solution to that problem.  Also, I couldn't find any 
documentation on the advantages or disadvantages of DB vs CT...


ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to