php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18746 DBM query cuts string
Submitted: 2002-08-05 15:28 UTC Modified: 2002-11-13 09:09 UTC
From: t2315 at freemail dot hu Assigned: helly (profile)
Status: Closed Package: DBM/DBA related
PHP Version: 4.2.2 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: t2315 at freemail dot hu
New email:
PHP Version: OS:

 

 [2002-08-05 15:28 UTC] t2315 at freemail dot 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-05 15:51 UTC] t2315 at freemail dot hu
I forgot to tell that I'm using Windows 2000 Professional
 [2002-08-05 18:31 UTC] t2315 at freemail dot hu
(1) Seems to be very similar to bugreport 16190
(2) Truncation looks dependent on key string length
 [2002-08-12 23:46 UTC] kalowsky@php.net
Can be reproduced in CVS on Win2k
 [2002-08-13 00:10 UTC] kalowsky@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 [2002-08-17 00:54 UTC] sfox@php.net
Sorry, this appeared fixed on first testing but actually isn't.  Keeping this one closed against the duplicate (re-opened) bug #16190.
 [2002-11-13 09:09 UTC] helly@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

See bug #16190 for details
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 00:01:28 2024 UTC