Bug #48186 [Fbk->NoF]: Symbol with code 0 in the 255 position of a string

From: Date: Sun, 20 Sep 2015 04:22:18 +0000
Subject: Bug #48186 [Fbk->NoF]: Symbol with code 0 in the 255 position of a string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196103@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=48186&edit=1 ID: 48186 Updated by: php-bugs@lists.php.net Reported by: aiskrenkov at gmail dot com Summary: Symbol with code 0 in the 255 position of a string -Status: Feedback +Status: No Feedback Type: Bug Package: PDO ODBC Operating System: Windows PHP Version: 5.2.9 Assigned To: cmb Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2015-09-08 14:36:19] cmb@php.net Is that still an issue with recent PHP versions? ------------------------------------------------------------------------ [2009-05-08 03:10:00] aiskrenkov at gmail dot com Description: ------------ Environment: Windows Server 2003 EE MS SQL server 8.0.818 (MSDE 2000) PHP 5.2.6(or high) as ISAPI or cli I have a table 'session': [id] [char](32) NOT NULL DEFAULT (''), [expiry] [bigint] NOT NULL DEFAULT ('0'), [data] [ntext] NOT NULL DEFAULT ('') When I retrive data from table and size of data more then 255 bytes, I found symbol with code 0(as EOL for strings) in the 255 position of the string. Reproduce code: --------------- <?php $dbname = "session_db"; $username = "sa"; $pw = "1q2w3e"; $pdo = new PDO ("odbc:session_db","sa","1q2w3e"); $query = $pdo->query("delete from session"); $string = '--'; $string .= '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'; $string .= '--'; echo 'Length of source string: '.strlen($string)."\n"; $query = $pdo->query("insert into session values('".md5(time())."', ".time().", '".$string."')"); var_dump($query); $rowset = $pdo->query("select * from session"); if($rowset === false) { var_dump($pdo->errorInfo()); } var_dump($rowset); $string = $rowset->fetchAll(); //$string = $rowset->fetchColumn(2); var_dump($string); echo 'Length of target string: '.strlen($string[0][2])."\n"; ?> Expected result: ---------------- 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 Actual result: -------------- 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123_45678901234567890123456789012345678901234567890 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=48186&edit=1

« previous php.bugs (#196103) next »