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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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)

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jan 07 01:01:29 2025 UTC