From:             dbaffaleuf at ixis-cib dot com
Operating system: Linux 2.6.9-22 RedHat AMD64 
PHP version:      4.4.2RC2
PHP Bug Type:     Sybase-ct (ctlib) related
Bug description:  sybase_query() fails on AMD64

Description:
------------
Acutally I have the problem both in PHP 4.4.1 and 4.4.2RC3


Always returns a correct resource id for the handler, but FALSE for the
query (see the following code)

The Sybase OpenClient warning code suggest an overflow in the
CS_DATAFMT.maxlength C struct. When returning, the datalength is sized
whether the type is CS_NUMERIC, CS_MONEY, etc... in the
php_sybase_fetch_result_set() fonction (src: php_sybase_ct.c). 

Works fine in DB-LIB.

The configure :

./configure     \
       
--prefix=/msmorzine/sgbd/contrib/src/php4-STABLE-200601091335/MKTEST    \
       
--with-sybase-ct=/msmorzine/sgbd/MX_MT_MSMORZINE/ASE1253/OCS-12_5/devlib
\
        --enable-static=sybase-ct \
       
--with-config-file-path=/msmorzine/sgbd/contrib/src/php4-STABLE-200601091335/MKTEST
\
        --with-apxs2=/msmorzine/sgbd/contrib/bin/apxs   \
        --with-gd=/msmorzine/sgbd/contrib/ \
        --enable-sysvmsg \
        --enable-sysvsem \
        --enable-sysvshm



Reproduce code:
---------------
The following code:

$STR    = "select name from syslogins";
$DBH    = @sybase_connect("MX_MT_MSMORZINE","sa", "mypassword");
$QUERY  = sybase_query($STR,$DBH);
var_dump($DBH);
var_dump($QUERY);

while($row = sybase_fetch_row($QUERY)) {
    while(list($k, $v) = each($row)) {
        echo "\$row[$k] => $v\n";
    }
}


Expected result:
----------------
int(4)
int(5)
$row[0] => probe
$row[0] => sa


Actual result:
--------------
"Warning: sybase_query(): Sybase:  Client message:  (): user api layer:
internal common library error: The bind of result set item 1 resulted in
truncation. (severity 116) in
/msmorzine/sgbd/contrib/src/php4-STABLE-200601091335/MKTEST/bin/test_sybase_ct.php
on line 5
resource(4) of type (sybase-ct link)
bool(false)".


-- 
Edit bug report at http://bugs.php.net/?id=35945&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=35945&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=35945&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=35945&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=35945&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=35945&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=35945&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=35945&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=35945&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=35945&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=35945&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=35945&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=35945&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=35945&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=35945&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=35945&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=35945&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=35945&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=35945&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=35945&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=35945&r=mysqlcfg

Reply via email to