|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72885 flatfile: dba_fetch() fails to read replaced entry
Submitted: 2016-08-18 20:39 UTC Modified: -
From: Assigned:
Status: Closed Package: DBM/DBA related
PHP Version: 7.1Git-2016-08-18 (Git) OS: Windows
Private report: No CVE-ID: None
 [2016-08-18 20:39 UTC]
When a flatfile database is opened in 'c' mode, fetching an entry
after having replaced it returns the old value. Note, that the
return value of dba_replace() is correct, i.e. the entry has
indeed been updated.

This issue occurs only on Windows, but not on Linux.

Test script:

$filename = __DIR__ . DIRECTORY_SEPARATOR . 'test.txt';

if (file_exists($filename)) unlink($filename);

$db = dba_open($filename, 'c', 'flatfile');
dba_insert('foo', 'bar', $db);
var_dump(dba_replace('foo', 'baz', $db));
var_dump(dba_fetch('foo', $db));

Expected result:
string(3) "baz"

Actual result:
string(3) "bar"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-27 20:54 UTC]
Automatic comment on behalf of ab
Log: Fixed bug #72885 flatfile: dba_fetch() fails to read replaced entry
 [2017-05-27 20:54 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 02:01:28 2024 UTC