Bug #60621 [Opn->Wfx]: dba_close() does not check for errors
| From: | mike@php.net | Date: | Thu, 05 Dec 2013 16:05:50 +0000 |
| Subject: | Bug #60621 [Opn->Wfx]: dba_close() does not check for errors | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183137@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60621&edit=1
ID: 60621
Updated by: mike@php.net
Reported by: tstarling@php.net
Summary: dba_close() does not check for errors
-Status: Open
+Status: Wont fix
Type: Bug
Package: DBM/DBA related
Operating System: Linux
PHP Version: 5.3SVN-2011-12-29 (SVN)
Block user comment: N
Private report: N
New Comment:
Unfortunately, not every DB handler supports a status code on close.
Previous Comments:
------------------------------------------------------------------------
[2011-12-29 05:07:59] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60621&edit=1