ID:               27131
 Updated by:       [EMAIL PROTECTED]
 Reported By:      akie at gods dot ru
-Status:           Open
+Status:           Bogus
 Bug Type:         MSSQL related
 Operating System: RedHat9 (linux 2.4.18)
 PHP Version:      4.3.4
 New Comment:

See bug #25777




Previous Comments:
------------------------------------------------------------------------

[2004-02-03 09:55:24] akie at gods dot ru

Maybe I am blind, but I can't find bug report with the similar
problem..
Or you mean that this problem is solved already?

------------------------------------------------------------------------

[2004-02-03 09:32:50] [EMAIL PROTECTED]

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Search before submit!


------------------------------------------------------------------------

[2004-02-03 09:14:55] akie at gods dot ru

Sorry, freetds 0.62 (tds version = 7.0)

------------------------------------------------------------------------

[2004-02-03 09:06:15] akie at gods dot ru

Description:
------------
After fixing this bug:
----
Fixed bug 25777 (Do not rtrim() of text fields fetched from mssql).
(Ilia)
----
problems arose. 
For some field in database (not necessarily varchar!), in PHP we obtain
the values with whitespaces at the ends. This produse incorrect
results/

Configurations:
MS SQL Server 7.0 on Windows 2000 Advanced Server
PHP4.3.4 on RedHat9 Linux with freetds 7.0

This problem has been observed after updating PHP (4.3.3=>4.3.4) at
www.stereo.ru and www.mobil.ru (many scripts started to work
incorrectly and it was necessary to trim even number fields..) 

Reproduce code:
---------------
[ MS SQL ]
CREATE TABLE test(id int NOT NULL, field tinyint NOT NULL)
INSERT INTO test(id, field) VALUES(1, 0)
INSERT INTO test(id, field) VALUES(2, 1)

CREATE PROCEDURE test_GetList
AS
SELECT id, field FROM test
GO

[ PHP ]
$con = sybase_connect("sqldev", "web_guest", "guest_web");
sybase_select_db($db);
$res = sybase_query("exec test_GetList", $con);
while ($obj = sybase_fetch_object($res)) {
   echo ">>".$obj->field."<<\n";
}

Expected result:
----------------
>>0<<
>>1<<

Actual result:
--------------
>>0_<<
>>1_<<

(here "_" means space symbol)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27131&edit=1

Reply via email to