php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #77710 Inconsistent expectation of returned values
Submitted: 2019-03-07 20:52 UTC Modified: -
From: v-yitam at microsoft dot com Assigned:
Status: Open Package: PDO related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-03-07 20:52 UTC] 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;
	}
...
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Nov 18 13:01:38 2019 UTC