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 |
|
||||||||||
| 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 commits
[2009-08-21 14:16 UTC] brandon at brandonsavage dot net
[2009-12-14 01:00 UTC] php-bugs at lists dot php dot net
[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