PHP 4.0 Bug #9934: faulty dbmfetch()
| From: | sma_husain at hotmail dot com | Date: | Thu, 22 Mar 2001 17:30:43 +0000 |
| Subject: | PHP 4.0 Bug #9934: faulty dbmfetch() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-49761@lists.php.net to get a copy of this message | ||
From: sma_husain@hotmail.com
Operating system: Windows NT/2000
PHP version: 4.0.4pl1
PHP Bug Type: DBM/DBA related
Bug description: faulty dbmfetch()
sample code:
<?
$db = dbmopen("test007","n");
dbminsert($db,"key1","data1");
dbminsert($db,"key2","data3");
dbminsert($db,"key2","data2");
print "\n<br> Value here should be data1: ";
print dbmfetch($db,"key1");
print "\n<br> Value here should be data2: ";
print dbmfetch($db,"key2");
print "\n<br> Value here should be data3: ";
print dbmfetch($db,"key3");
dbmclose($db);
?>
here is the bug description:
don't even try using this function in php4.x on windows. it is extremely buggy; returns bad
data. typically, you will find the first character of inserted data missing, with some wierd chars
at the end. on examining the dbm file, it seems the php_dbm.dll methods are incorrectly reading data
by skipping the first character, reading the rest of the string and then getting completely messed
up because all following string length entries are "shifted".
i don't know how this huge bug has survived in all php 4.x implementations on windows. it
basically renders php 4.x on windows useless for disk based db access. i replaced my 4.x install
with 3.x and had no problem running my dbm code.
please somebody! fix this!
thanks,
amir
--
Edit Bug report at: http://bugs.php.net/?id=9934&edit=1