PDO returns null when SQLite connection fails

Bug #49320 PDO returns null when SQLite connection fails
Submitted: 2009-08-21 13:45 UTC Modified: 2010-06-13 00:05 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: brandon at brandonsavage dot net Assigned: felipe (profile)
Status: Closed Package: PDO related
PHP Version: 5.2.10 OS: All
Private report: No CVE-ID: None

 [2009-08-21 13:45 UTC] brandon at brandonsavage dot net

Description:
------------
The PDO extension should either return an object or throw an exception. However, with PDO and the SQLite driver, this does not happen.

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

//Use the wrong driver so the connection fails
$pdo = new PDO('sqlite2:bookstore.db');

var_dump($pdo);

Expected result:
----------------
PDOException

Actual result:
--------------
null

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2009-08-21 14:16 UTC] brandon at brandonsavage dot net

The version is mentioned as 5.2.10 but i tested this in 5.3.0 and it exists there as well.

 [2009-12-14 01:00 UTC] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

 [2010-06-13 00:05 UTC] felipe@php.net

-Status: No Feedback +Status: Closed -Assigned To: +Assigned To: felipe

 [2010-06-13 00:05 UTC] felipe@php.net

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.