php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58224 string length limit when reading data
Submitted: 2008-06-06 09:19 UTC Modified: 2008-10-16 05:22 UTC
From: danhen at web dot de Assigned:
Status: Closed Package: PDO_SQLITE (PECL)
PHP Version: 5_3 CVS-2008-06-06 (dev) OS: WinXP
Private report: No CVE-ID: None
 [2008-06-06 09:19 UTC] danhen at web dot de
Description:
------------
When using current PHP5.3 CVS version a string-limit around 980 bytes occours when reading text-data. The maximum length seems to differ when the table has another structure but is always around 980 bytes. When reading untill a = 981 everthing works fine.

Reproduce code:
---------------
<?php

$oDb = new PDO('sqlite:test.sqlite');

$oDb->query('CREATE TABLE test (a, b)');

$sStr = '';


for($i = 0; $i < 1000; $i++) {

  $sStr.= 'A';

  $oDb->query('INSERT INTO test (a, b) VALUES (\''.$i.'\', \''.$sStr.'\')');

}

class test {

}


$oStmt = $oDb->query('SELECT * FROM test WHERE a = \'982\'');

$oResult = $oStmt->fetchObject('test');

print_r($oResult);


?>

Expected result:
----------------
test Object ( [a] => 982 [b] => AAAAA ... a string containing 982 'A' )

Actual result:
--------------
Fatal error: Call to a member function fetchObject() on a non-object in sqlitetest.php on line 28

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-15 17:47 UTC] scottmac@php.net
Can you try a 5.3 snapshot from http://windows.php.net/snapshots/
 [2008-10-16 05:22 UTC] danhen at web dot de
Everything works fine with latest Thread-Save VC6-snapshot. Thanks.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 19:01:25 2019 UTC