ID: 29064 User updated by: daniel dot beet at accuratesoftware dot com Reported By: daniel dot beet at accuratesoftware dot com Status: Assigned Bug Type: Sybase-ct (ctlib) related Operating System: Windows 2000 Server PHP Version: 4.3.7 / HEAD Assigned To: thekid New Comment:
I have tested the complete patch set against PHP 4, and have found no major issues. I did notice that MONEY columns only have 2 decimal places fetched back rather than the stored 4 places (this is also the case currently), but (not sure why, something to do with the default formating within Sybase for Money columns maybe?) the patch I did brought back 4 decimal places. This is not an issue for me, but does not seem quite right. Just wondering about the consistency of the different database drivers in PHP. MSSQL and OCI8 return numeric/decimals as numeric strings all the time. I would hope that where possible, all the database extensions would return data in a similar way. Thanks for your help! Dan Previous Comments: ------------------------------------------------------------------------ [2004-07-11 18:40:53] [EMAIL PROTECTED] I fixed this bug locally but still have quite an amount of other bugfixes / improvements lying around, which I don't want to separate from this. Maybe you'd like to test the complete patchset available at http://sitten-polizei.de/php/sybase_ct.diff (HEAD) http://sitten-polizei.de/php/sybase_ct4.diff (PHP_4 branch) As soon as I've tested the other changes enough, I'll commit everything to CVS (should be in a couple of days) ------------------------------------------------------------------------ [2004-07-11 15:35:00] [EMAIL PROTECTED] Testcase now available at: http://sitten-polizei.de/php/bug29064.phpt (place in ext/sybase_ct/tests and run make test TESTS=ext/sybase_ct, be sure to edit ext/sybase_ct/tests/test.inc and supply correct DS_QUERY and credentials there) ------------------------------------------------------------------------ [2004-07-11 15:29:26] [EMAIL PROTECTED] Seeing that the PHP version in the Bug report was 4.3.7, I also made a patch against the PHP4 branch. http://sitten-polizei.de/php/float_precision-php4.diff ------------------------------------------------------------------------ [2004-07-11 13:56:26] [EMAIL PROTECTED] Have a look at the following: http://sitten-polizei.de/php/float_precision.diff This accomplishes the "best-result"-semantics described in my above comments. I use EG(precision) to check where we overflow - as I understand, this value is the precision to which floats are still "correct". ------------------------------------------------------------------------ [2004-07-11 13:26:01] [EMAIL PROTECTED] Btw: Sybase-CT behaves like PHP itself (due to the afforementioned reason): $ php -r 'var_dump(12345678901234567890123456789012.123456);' float(1.23456789012E+31) (the above result depends on the precision set: $ php -dprecision=20 -r 'var_dump((float)"12345678901234567890123456789012.123456");' float(1.234567890123457E+31) ------------------------------------------------------------------------ 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/29064 -- Edit this bug report at http://bugs.php.net/?id=29064&edit=1