#28314 [Bgs]: sybase-ct's MSSQL_ASSOC not defined

From: Date: Sat, 08 May 2004 12:50:22 +0000
Subject: #28314 [Bgs]: sybase-ct's MSSQL_ASSOC not defined
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-59395@lists.php.net to get a copy of this message
ID: 28314 Updated by: wez@php.net Reported By: adamh at densi dot com Status: Bogus Bug Type: Sybase-ct (ctlib) related Operating System: Linux PHP Version: 4.3.4 New Comment: Because you need to have the mssql extension loaded to use its constants. Previous Comments: ------------------------------------------------------------------------ [2004-05-08 14:40:08] adamh at densi dot com Yes, obviously I can use mssql_* functions using FreeTDS. But I can *also* use them with --with-sybase-ct. When I use them with SybaseCT, they do not behave as documented. To me, the FreeTDS argument sounds like, "If you've found a bug in strlen() with uClibc, you can use glibc instead." And yes, I can, but that doesn't mean uClibc doesn't have a bug. This seems so clear-cut to me I know I must be missing something. Why is this not a bug? ------------------------------------------------------------------------ [2004-05-07 23:46:36] fmk@php.net If you want to use the mssql_* functions you can use the --with-mssql option. This requires FreeTDS. ------------------------------------------------------------------------ [2004-05-07 18:16:19] adamh at densi dot com I'm delving into the source, so please correct me if I err: Inside the source, sybase_fetch_array() and sybase_fetch_assoc() both call php_sybase_fetch_hash(), in exactly the same manner as php_mssql_fetch_hash(). In other words, mssql_fetch_assoc($r) (the "real" one) is equivalent to mssql_fetch_array($r, MSSQL_ASSOC) internally, since both functions call php_mssql_fetch_hash() with different arguments. I see a direct parallel to Sybase_ct's php_sybase_fetch_hash(), with two differences: 1. php_sybase_fetch_hash() doesn't parse for the possible second argument. 2. MSSQL_ASSOC is not defined. However, both of these issues are trivial to resolve, aren't they? It seems to me that sybase_ct should conform to mssql on commonly used, well-documented functions. ------------------------------------------------------------------------ [2004-05-07 18:02:50] iliaa@php.net The MSSQL_ASSOC constant is ONLY defined by the mssql extension. The sybase extension does not define this constant because sybase_fetch_array() (on which mssql_fetch_array()) is based on in sybase* extension does not support this feature. You should instead be using the sybase_fetch_assoc() function. ------------------------------------------------------------------------ [2004-05-07 17:57:43] adamh at densi dot com I respectfully disagree. Sybase_ct gives access to the mssql_fetch_array() function and yet the function does *not* follow the documentation. This is obviously a bug in sybase_ct! php -m does not show mssql; however, it does show sybase_ct. And mssql_fetch_array() is defined and works... but not the way it is supposed to. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/28314 -- Edit this bug report at http://bugs.php.net/?id=28314&edit=1

« previous php.bugs (#59395) next »