Bug #72885 [Opn->Csd]: flatfile: dba_fetch() fails to read replaced entry
Edit report at https://bugs.php.net/bug.php?id=72885&edit=1
ID: 72885
Updated by: ab@php.net
Reported by: cmb@php.net
Summary: flatfile: dba_fetch() fails to read replaced entry
-Status: Open
+Status: Closed
Type: Bug
Package: DBM/DBA related
Operating System: Windows
PHP Version: 7.1Git-2016-08-18 (Git)
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=36b5ab15f4ee2b783dd67f72d6530c15337b6652
Log: Fixed bug #72885 flatfile: dba_fetch() fails to read replaced entry
Previous Comments:
------------------------------------------------------------------------
[2016-08-18 20:39:45] cmb@php.net
Description:
------------
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:
---------------
<?php
$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));
dba_close($db);
Expected result:
----------------
bool(true)
string(3) "baz"
Actual result:
--------------
bool(true)
string(3) "bar"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72885&edit=1
Thread (2 messages)