|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34495 dba_fetch() fails with db4 driver when dba_popen() is used
Submitted: 2005-09-14 01:37 UTC Modified: 2005-12-08 20:41 UTC
From: pookey at pookey dot co dot uk Assigned: helly (profile)
Status: Closed Package: DBM/DBA related
PHP Version: 5CVS-2005-09-14 (snap) OS: Linux
Private report: No CVE-ID: None
 [2005-09-14 01:37 UTC] pookey at pookey dot co dot uk
 where the use of dba_open works, dba_popen does not. 

Reproduce code:
  $file = dirname(__FILE__) . '/dbtest.db';

  $db = dba_open($file, "c", "db4");
  dba_insert('moo', 'baa', $db);
  $value = dba_fetch('moo', $db);
  echo "<b>non-persistant check:</b> $value <hr />";
  $db = dba_popen($file, "c", "db4");
  $value = dba_fetch('moo', $db);
  echo "<b>persistant check:</b> $value <hr />";

  $db = dba_open($file, "c", "db4");
  $value = dba_fetch('moo', $db);
  echo "<b>non-persistant check:</b> $value <hr />";
  dba_delete('moo', $db);

Expected result:
all 3 echo statements ina bove should print 'baa'. 

Actual result:
the middle echo statement doesn't print baa 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-14 03:04 UTC] pookey at pookey dot co dot uk
I've updated this page with a lot more information:  
It appears it's just db4 with the problem
 [2005-09-14 15:11 UTC]
RCS file: /repository/php-src/ext/dba/dba_db4.c,v
revision 1.10
date: 2003/06/21 18:16:38;  author: helly;  state: Exp;  lines: +4 -0
When persistent then we may use threads

Removing this part:

+       if (info->flags & DBA_PERSISTENT) {
+               gmode |= DB_THREAD;
+       }

Makes dba_fetch() work with db4 driver also if opened in persistent mode.

 [2005-09-14 15:45 UTC]
Thanks for the fix - should I add a note to under 
dba_popen about this not working in pre-5.1 ? 
 [2005-11-07 14:58 UTC]
Please try this patch (against 5.1RC5-dev):

 [2005-11-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2005-12-08 20:41 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 20:01:29 2024 UTC