php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60621 dba_close() does not check for errors
Submitted: 2011-12-29 05:07 UTC Modified: 2013-12-05 16:05 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: tstarling@php.net Assigned:
Status: Wont fix Package: DBM/DBA related
PHP Version: 5.3SVN-2011-12-29 (SVN) OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tstarling@php.net
New email:
PHP Version: OS:

 

 [2011-12-29 05:07 UTC] tstarling@php.net
Description:
------------
Please make PHP_FUNCTION(dba_close) return true for success, and raise a warning and return false on failure, as per the usual PHP convention.

PHP_FUNCTION(dba_close) calls zend_list_delete(), which doesn't provide any way for the handlers to report errors either via php_error_docref() or by returning false to the caller.

Some handlers (such as CDB) write a large amount of data to disk on close, and so a disk full error can easily be encountered, e.g.
https://bugzilla.wikimedia.org/show_bug.cgi?id=33409

You could change the prototype for dba_handler.close and dba_close() to return int, and you could make PHP_FUNCTION(dba_close) call dba_close() directly before destroying the resource. dba_close() would need to be modified slightly to avoid dangling pointers.


Patches

add-fronk-support (last revision 2013-11-11 15:07 UTC by ladycuyik14 at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-05 16:05 UTC] mike@php.net
-Status: Open +Status: Wont fix
 [2013-12-05 16:05 UTC] mike@php.net
Unfortunately, not every DB handler supports a status code on close.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 05:01:27 2024 UTC