php.net |  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
Votes:2
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:
MUST BE VALID
Solve the problem:
44 - 31 = ?
Subscribe to this entry?

 
 [2011-08-06 18:01 UTC] riverfish323 at yahoo dot co dot jp
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-01 12:43 UTC] felipe@php.net
-Package: PDO related +Package: PDO SQLite
 [2021-06-02 14:51 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-06-02 14:51 UTC] cmb@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 12:01:30 2024 UTC