|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55377 Can't unlock SQLite3 when error occurs in PDOStatement iterating.
Submitted: 2011-08-06 18:01 UTC Modified: 2021-06-13 04:22 UTC
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: riverfish323 at yahoo dot co dot jp Assigned: cmb (profile)
Status: No Feedback Package: PDO SQLite
PHP Version: 5.3.6 OS: WindowsXP SP3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
47 - 7 = ?
Subscribe to this entry?

 [2011-08-06 18:01 UTC] riverfish323 at yahoo dot co dot jp
Sorry for strange Engrish.

SQLite3 database didn't unlock, when fatal error occurs while iterating over a PDOStatement object using foreach-loop.

Test script:
$con = new PDO('sqlite:test.db');

$con->query('CREATE TABLE IF NOT EXISTS t (c INT)');

$con->query('INSERT INTO t VALUES (1)');

foreach ($con->query('SELECT * FROM t LIMIT 1') as $row) {
    trigger_error('abort', E_USER_ERROR); # test.db not unlocking

Expected result:
Will not be able to use some SQL statements. In addition PHP will be timeout.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-01 12:43 UTC]
-Package: PDO related +Package: PDO SQLite
 [2021-06-02 14:51 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-06-02 14:51 UTC]
I cannot reproduce this with PHP 7.4 and sqlite3 3.31.1; maybe an
issue with an old PHP or SQLite3 version?
 [2021-06-13 04:22 UTC] php-bugs at lists dot php dot net
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.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jul 30 19:01:23 2021 UTC