Doc #74397 [Ver->Csd]: Filename can also be empty string for in-memory db
| From: | cmb@php.net | Date: | Tue, 11 Apr 2017 14:13:51 +0000 |
| Subject: | Doc #74397 [Ver->Csd]: Filename can also be empty string for in-memory db | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-14610@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74397&edit=1
ID: 74397
Updated by: cmb@php.net
Reported by: aarjan at hotmail dot com
Summary: Filename can also be empty string for in-memory db
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: SQLite related
Operating System: Windows
PHP Version: 7.0.17
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2017-04-11 14:13:22] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=342307
Log: Fix #74397: Filename can also be empty string for in-memory db
------------------------------------------------------------------------
[2017-04-11 14:00:13] cmb@php.net
> This will result in a in-memory database.
Not quite. If the database name is an empty string, a private,
temporary on-disk database is created.
However, you're right that this has to be properly documented.
------------------------------------------------------------------------
[2017-04-09 15:25:25] aarjan at hotmail dot com
Typo fix in summary
------------------------------------------------------------------------
[2017-04-09 15:22:03] aarjan at hotmail dot com
Description:
------------
---
From manual page: http://www.php.net/sqlite3.construct
---
https://github.com/php/php-src/commit/cc125f277b50e0f90fc8033fe7f47d2446389a15
According to this commit, the filename in the constructor may also be an empty string since v7.0.10.
This will result in a in-memory database. In previous versions of PHP7 (I tested this with v7.0.2)
this would have resulted in a exception.
The documentation is not mentioning this feature.
Test script:
---------------
The unit test below works in v7.0.2, but fails in v7.0.17
class SQLiteConstructorTest extends PHPUnit_Framework_TestCase
{
/**
* @expectedException Exception
*/
public function testDefectDatabaseFile()
{
$database_file = '';
$sqlitedb = new SQLite3($database_file);
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74397&edit=1