Bug #72885 [NEW]: flatfile: dba_fetch() fails to read replaced entry
| From: | cmb@php.net | Date: | Thu, 18 Aug 2016 20:39:46 +0000 |
| Subject: | Bug #72885 [NEW]: flatfile: dba_fetch() fails to read replaced entry | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-203381@lists.php.net to get a copy of this message | ||
From: cmb
Operating system: Windows
PHP version: 7.1Git-2016-08-18 (Git)
Package: DBM/DBA related
Bug Type: Bug
Bug description:flatfile: dba_fetch() fails to read replaced entry
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 bug report at https://bugs.php.net/bug.php?id=72885&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72885&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72885&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72885&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72885&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72885&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72885&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72885&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72885&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72885&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72885&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72885&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72885&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72885&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72885&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72885&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72885&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72885&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72885&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72885&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72885&r=mysqlcfg