php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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-06 22:15 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [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:04 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=300413
Log: - Fixed bug #49320 (PDO returns null when SQLite connection fails)
 [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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC