Req->Doc #77710 [Opn->Ver]: Inconsistent expectation of returned values
| From: | cmb@php.net | Date: | Tue, 10 Mar 2020 10:05:15 +0000 |
| Subject: | Req->Doc #77710 [Opn->Ver]: Inconsistent expectation of returned values | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17389@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77710&edit=1
ID: 77710
Updated by: cmb@php.net
Reported by: v-yitam at microsoft dot com
Summary: Inconsistent expectation of returned values
-Status: Open
+Status: Verified
-Type: Feature/Change Request
+Type: Documentation Problem
Package: PDO related
Operating System: Irrelevant
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Indeed, the documentation[1] is in error.
[1] <https://www.php.net/manual/en/internals2.pdo.implementing.php#internals2.pdo.implementing.statement.get-col-meta>
Previous Comments:
------------------------------------------------------------------------
[2019-03-07 20:52:39] v-yitam at microsoft dot com
Description:
------------
PDO expects different returned values from PDOStatement::getColumnMeta()
- the other methods in the API returns 0 for failure and 1 for success
- but getColumnMeta should return FAILURE (-1) or SUCCESS(0) instead (enum ZEND_RESULT_CODE?)
Confirmed this part of the PDO code is the same in PHP 5.6, 7.1, 7.2 and 7.3
static PHP_METHOD(PDOStatement, getColumnMeta)
{
...
PDO_STMT_CLEAR_ERR();
if (FAILURE == stmt->methods->get_column_meta(stmt, colno, return_value)) {
PDO_HANDLE_STMT_ERR();
RETURN_FALSE;
}
...
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77710&edit=1