Req #72653 [Opn]: SQLite should allow opening with empty filename
| From: | cmb@php.net | Date: | Sun, 24 Jul 2016 11:36:40 +0000 |
| Subject: | Req #72653 [Opn]: SQLite should allow opening with empty filename | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202557@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72653&edit=1
ID: 72653
Updated by: cmb@php.net
Reported by: nazar at mokrynskyi dot com
Summary: SQLite should allow opening with empty filename
Status: Open
Type: Feature/Change Request
-Package: SQLite
+Package: SQLite related
PHP Version: 7.0.9
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
As Sqlite3 already supports the :memory: pseudo filename, it would
make sense to also support empty filenames.
BTW: the other bug you're mentioning refers to the SQLite
extension, which is unmaintained since a long time anyway.
Previous Comments:
------------------------------------------------------------------------
[2016-07-22 19:36:38] nazar at mokrynskyi dot com
Description:
------------
SQLite allows to open database with empty filename (https://www.sqlite.org/c3ref/open.html):
> If the filename is an empty string, then a private, temporary on-disk database will be created.
> This private database will be automatically deleted as soon as the database connection is closed.
This is also true for HHVM implementation: https://github.com/facebook/hhvm/issues/7225
Would be nice to be consistent and add support for this in PHP as well (especially, since underlying
interface already have it).
P.S. https://bugs.php.net/bug.php?id=27928
doesn't seem to be relevant here anymore
Test script:
---------------
<?php
new SQLite3('');
Expected result:
----------------
No output
Actual result:
--------------
PHP Fatal error: Uncaught Exception: Unable to expand filepath in %s:2
Stack trace:
#0 %s(2): SQLite3->__construct('')
#1 {main}
thrown in %s on line 2
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72653&edit=1