#18746 [Opn->Ver]: DBM query cuts string

From: Date: Tue, 13 Aug 2002 03:46:23 +0000
Subject: #18746 [Opn->Ver]: DBM query cuts string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-16564@lists.php.net to get a copy of this message
ID: 18746 Updated by: kalowsky@php.net Reported By: t2315@freemail.hu -Status: Open +Status: Verified Bug Type: DBM/DBA related Operating System: Windows 2000 PHP Version: 4.2.2 New Comment: Can be reproduced in CVS on Win2k Previous Comments: ------------------------------------------------------------------------ [2002-08-05 18:31:51] t2315@freemail.hu (1) Seems to be very similar to bugreport 16190 (2) Truncation looks dependent on key string length ------------------------------------------------------------------------ [2002-08-05 15:51:28] t2315@freemail.hu I forgot to tell that I'm using Windows 2000 Professional ------------------------------------------------------------------------ [2002-08-05 15:28:15] t2315@freemail.hu I'm using PHP 4.2.2 for Windows with Apache 1.3.24. I have loaded php_db.dll for DBM support. When writing to a DBM database and re-reading data, I get different from that I inserted. Here is a script to reproduce the problem: [please delete "db" & "db.lck" if exists] <? $dbm=dbmopen("db","c") or die("DBM error"); dbmreplace($dbm,"7","alpha"); echo dbmfetch($dbm,"7"); dbmclose($dbm); ?> The program output is "lpha" (w/o quotes). The starting "a" seems to be cut. When analyzing the "db" file, it contains the whole string (31 0A 37 35 0A 61 6C 70 68 61 00). I'm not completely sure if it is a php bug, I'm also interested whether you can reproduce the error or not. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18746&edit=1

« previous php.bugs (#16564) next »