|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #73068 SQLite3 may fail to DELETE
Submitted: 2016-09-12 23:38 UTC Modified: 2016-09-13 14:31 UTC
From: alejosimon at gmail dot com Assigned: ab (profile)
Status: Closed Package: SQLite related
PHP Version: Irrelevant OS: Windows 7 x64
Private report: No CVE-ID: None
 [2016-09-12 23:38 UTC] alejosimon at gmail dot com
In the last realease of sqlite anunce 2 important bug fixed:

Especially the first one, I think that should be updated immediately for being a common use query as DELETE.

Thank you, sorry for my english.

Test script:

$db = new \PDO( 'sqlite::memory:' ) ;
$db->exec( "

	SELECT * FROM t1 WHERE a='1' AND b='2';

	DELETE FROM t1 WHERE a='1' AND b='2';
" );

print_r( $db->query( "SELECT * FROM t1;" )->fetchAll() );


Expected result:

Actual result:
    [0] => Array
            [a] => 1
            [0] => 1
            [b] => 2
            [1] => 2



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-13 11:06 UTC]
-Summary: Update buldle sqlite lib for severe bug. +Summary: SQLite3 may fail to DELETE -Status: Open +Status: Verified -Package: PDO SQLite +Package: SQLite related -Assigned To: +Assigned To: cmb
 [2016-09-13 11:06 UTC]
I don't think that the second issue is too much of a problem,
because the bug report states:

> This problem has been in the code since before version 3.3.7
> (2006-08-12), and and hence gone unnoticed for over ten years.
> For that reason, it is given a low severity.

The first issue, however, appears to be real problem.

Anyhow, SQLite 3.14.2 has already been released, so PHP 7.1+ will
have to be updated anyway. PHP 5.6 is still on SQLite,
and as such is not affected by the first issue. It's not yet clear
to me what to do with PHP 7.0, which is still on SQLite 3.13.0.
 [2016-09-13 11:25 UTC]
-Summary: SQLite3 may fail to DELETE +Summary: Update to SQLite 3.14.2 -Type: Bug +Type: Feature/Change Request
 [2016-09-13 11:25 UTC]
After further consideration, I don't think this qualifies as bug,
because users can compile against a custom libsqlite3.
 [2016-09-13 11:42 UTC]
-Assigned To: cmb +Assigned To: ab
 [2016-09-13 11:42 UTC]
I have updated PHP 7.1+ to SQLite 3.14.2, see

Anatol, should PHP 7.0 be updated as well?
 [2016-09-13 13:29 UTC] alejosimon at gmail dot com
cmb... ought to be! jeje!

... not forget that most web developers do not compile php, and the Windows users always depend on the compiled versions.

 [2016-09-13 14:00 UTC]
-Status: Verified +Status: Closed
 [2016-09-13 14:00 UTC]
I've added libsqlite 3.14.2 to 7.0 dev as well. For the upcoming release, the bundled libsqlite is downgraded to latest known stable 3.8.x. For PHP 7.0.12 we'll see further then, whether to instantly revert libsqlite to 3.8.x or to keep 3.14.2.

 [2016-09-13 14:01 UTC]
-Summary: Update to SQLite 3.14.2 +Summary: SQLite3 may fail to DELETE
 [2016-09-13 14:01 UTC]
Btw. this is not a bug in PHP, but since we bundle libsqlite, it affects quite some users. Lets keep the title therefore. I've also added a test to this behavior.

 [2016-09-13 14:14 UTC] alejosimon at gmail dot com

According to my way of seeing it .. if SQL is within PHP or part of it ... it inherits its bugs! according to my interpretation course!

Internally you know it's another lib, but with a faraway look ... is simply a part of PHP.

thanks for the quick update.
 [2016-09-13 14:31 UTC]
@alejosimon, the latests Windows snaps will contain libsqlite 3.14.2. You can fetch the ext DLLs here . And of course please keep in mind the 7.0.12 RC in a couple of weeks.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 01:01:31 2024 UTC