#38805 [Com]: PDO Truncates Text from SQL Server Text Data Type Field

From: Date: Tue, 14 Oct 2008 22:31:17 +0000
Subject: #38805 [Com]: PDO Truncates Text from SQL Server Text Data Type Field
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-129696@lists.php.net to get a copy of this message
ID: 38805 Comment by: mario dot estrada at gmail dot com Reported By: gkrajci at arescorporation dot com Status: Assigned Bug Type: PDO related Operating System: Windows NT PBMA-WB2 5.2 build 37 PHP Version: 5.1.6 Assigned To: wez New Comment: Come on guys, please fix this! This is a MAJOR bug and it seems like you really don't care! Previous Comments: ------------------------------------------------------------------------ [2008-09-19 12:49:17] J dot Antonio at jaruz dot com This issue is now more then TWO YEARS old. Can "wez" please have a look at it? ------------------------------------------------------------------------ [2008-09-18 14:04:18] chinnet at 126 dot com My php version is 5.2.3. Now,I use PDO_MSSQL read the image type data from SQL Server 2000. But i only get 4096B from the db. so what can i do? ; Valid range 0 - 2147483647. Default = 4096. mssql.textlimit = 2147483647 ; Valid range 0 - 2147483647. Default = 4096. mssql.textsize = 2147483647 This is supported by php_mssql.dll.But not supported by PDO_MSSQL! so it is very important! ------------------------------------------------------------------------ [2008-08-04 12:40:00] gkrajci at arescorporation dot com Trying $pdo->query('SET TEXTSIZE {number}'); did not work... $dbh = new PDO($pdo_dsn, $db_user, $db_password); $sql = "SELECT the_content, DATALENGTH(the_content) AS d_l FROM content WHERE content_id = 578"; $dbh->query('SET TEXTSIZE 300000'); $stmt = $dbh->prepare($sql); $stmt->execute(); while ( $row = $stmt->fetch() ) { $video_count++; echo 'LENGTH: '.strlen($row["the_content"]).', '.$row["d_l"].'<br />'; } OUTPUT: LENGTH: 4096, 24868 ------------------------------------------------------------------------ [2008-07-30 13:18:39] kristaps at kraksti dot lv Hello! Have you tried $pdo->query('SET TEXTSIZE {number} '); Where number is text size (in bytes). Max number is 2 GB in bytes. ------------------------------------------------------------------------ [2008-06-20 13:39:10] mcleod at spaceweb dot nl Also on: OS: Windows XP Pro PHP version: 5.2.5 MSSQL server 2005 It worries me that it affects Zend_Db. I experienced it using PDO directly. ------------------------------------------------------------------------ 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/38805 -- Edit this bug report at http://bugs.php.net/?id=38805&edit=1

« previous php.bugs (#129696) next »