php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #77710 Inconsistent expectation of returned values
Submitted: 2019-03-07 20:52 UTC Modified: 2020-03-10 10:05 UTC
From: v-yitam at microsoft dot com Assigned: cmb (profile)
Status: Closed Package: PDO related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-03-10 10:05 UTC] cmb@php.net
-Status: Open +Status: Verified -Type: Feature/Change Request +Type: Documentation Problem -Assigned To: +Assigned To: cmb
 [2020-03-10 10:07 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=349367
Log: Fix #77710: Inconsistent expectation of returned values
 [2020-03-10 10:08 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=3a68a5895a1188492f3d4d28da01a0f0fa6f366a
Log: Fix #77710: Inconsistent expectation of returned values
 [2020-03-10 10:08 UTC] phpdocbot@php.net
-Status: Verified +Status: Closed
 [2020-03-10 14:21 UTC] mumumu@php.net
Automatic comment from SVN on behalf of mumumu
Revision: http://svn.php.net/viewvc/?view=revision&revision=349371
Log: Fix #77710: Inconsistent expectation of returned values
 [2020-03-10 14:25 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=94324e7ad11bcff6436e50569dd67970f7979cd1
Log: Fix #77710: Inconsistent expectation of returned values
 [2020-12-30 11:59 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=b3b6e997991ecd703a030494ba3d9319afcbdf40
Log: Fix #77710: Inconsistent expectation of returned values
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 28 12:03:36 2021 UTC