php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57041 Silent death when using sqlite2: DSN with relative path
Submitted: 2006-05-25 15:55 UTC Modified: 2021-05-03 11:43 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: hans at velum dot net Assigned: cmb (profile)
Status: Not a bug Package: *General Issues
PHP Version: 5.1.0 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hans at velum dot net
New email:
PHP Version: OS:

 

 [2006-05-25 15:55 UTC] hans at velum dot net
Description:
------------
I'm not sure if this is the correct forum for this bug, as it's a bug when using sqlite2 DSN (PHP 5.1.4).

The problem is that the call to new PDO(...) returns NULL when the DSN specifies a relative path and no error is issued.  (I realize that the instructions say to use an absolute path, but since this is not necessary with the sqlite lib in PHP, this silent death is bound to cause perplexion for users.)

Reproduce code:
---------------
$pdo = new PDO("sqlite2:./my.db");


Expected result:
----------------
PHP Fatal error:  Uncaught exception 'PDOException' with message 'could not connect to database ....'

Actual result:
--------------
NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-12 10:38 UTC] tellme dot 3 dot n1 at dfgh dot net
The problem is not limited to relative paths. If "./my.db" is non-readable, the same behavior occurs, even if the full path is specified.
 [2021-05-03 11:43 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Package: PDO_SQLITE +Package: *General Issues -Assigned To: +Assigned To: cmb
 [2021-05-03 11:43 UTC] cmb@php.net
The sqlite2 driver is no longer supported for many years, so this
ticket is obsolete.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 13:01:30 2024 UTC