|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62489 dba_insert not working as expected
Submitted: 2012-07-06 08:40 UTC Modified: 2013-01-15 08:39 UTC
From: marc-bennewitz at arcor dot de Assigned: lstrojny (profile)
Status: Closed Package: DBM/DBA related
PHP Version: 5.4.4 OS: openSUSE 11.3 (x86_64)
Private report: No CVE-ID: None
 [2012-07-06 08:40 UTC] marc-bennewitz at arcor dot de
The function "dba_insert" doesn't work as expected with most handlers.
On calling "dba_insert" on an already existing key the function should return false and do not trigger a warning but that's not the case on most tested handlers.

Test script:
$dba = dba_open(sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid('dba_'), 'c', 'qdbm');

var_dump(dba_insert('key', 'test1', $dba));
var_dump(dba_insert('key', 'test2', $dba));
var_dump(dba_fetch('key', $dba));

Expected result:
string(5) "test1"

Actual result:
flatfile   true     false    YES
inifile    true     true     NO
gdbm       true     false    YES
qdbm       true     false    YES
db4        true     false    NO
-> Didn't test not listed handlers !


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-15 08:39 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

Fixed in the 5.5 and master trees.
 [2013-01-15 08:39 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: lstrojny
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 03:01:29 2024 UTC