php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57331 column values have last character truncated on SELECT
Submitted: 2006-10-28 18:36 UTC Modified: 2006-10-31 00:01 UTC
From: fletch at pobox dot com Assigned:
Status: Closed Package: PDO_SQLITE (PECL)
PHP Version: 5.1.6 OS: Fedora Core 6
Private report: No CVE-ID:
 [2006-10-28 18:36 UTC] fletch at pobox dot com
Description:
------------
All SELECTed values have the final character truncated.

Version information from phpinfo():

PECL Module version:  1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6 2006/01/01 12:50:12 sniper Exp $
SQLite Library:       3.3.6

Reproduce code:
---------------
<?php
$dbh = new PDO( 'sqlite::memory:' );

$dbh->query( 'CREATE TABLE "things" ( name VARCHAR NOT NULL )');
$dbh->query( 'INSERT INTO things VALUES ( "thing one" )');

foreach( $dbh->query( 'SELECT * FROM things' ) as $row ) {
	print_r( $row );
}
$dbh = null;
?>

Expected result:
----------------
Array
(
    [name] => thing one
    [0] => thing one
)

Actual result:
--------------
Array
(
    [name] => thing on
    [0] => thing on
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-28 18:48 UTC] fletch at pobox dot com
When performing these queries with the sqlite3 command line client on the same box, the values are returned intact.
 [2006-10-31 00:01 UTC] fletch at pobox dot com
I've compiled from CVS and this bug appears to be fixed.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 12:02:28 2014 UTC