[php-src] master: Add ZEND_ASSERT to stmt->errorCode

From: Date: Sun, 25 Apr 2021 14:57:41 +0000
Subject: [php-src] master: Add ZEND_ASSERT to stmt->errorCode
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-115797@lists.php.net to get a copy of this message
Author: Kamil Tekiela (kamil-tekiela) Committer: George Peter Banyard (Girgias) Date: 2021-04-25T15:57:43+01:00 Commit: https://github.com/php/php-src/commit/3292b9761a1bebc096a903dc17feaa1e42a44312 Raw diff: https://github.com/php/php-src/commit/3292b9761a1bebc096a903dc17feaa1e42a44312.diff Add ZEND_ASSERT to stmt->errorCode Changed paths: M ext/pdo/pdo_stmt.c M ext/pdo/pdo_stmt.stub.php M ext/pdo/pdo_stmt_arginfo.h Diff: diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index dd3fa4cacf56d..63fbd70c8613d 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1529,9 +1529,7 @@ PHP_METHOD(PDOStatement, errorCode) ZEND_PARSE_PARAMETERS_NONE(); PHP_STMT_GET_OBJ; - if (stmt->error_code[0] == '\0') { - RETURN_NULL(); - } + ZEND_ASSERT(stmt->error_code[0] != '\0'); RETURN_STRING(stmt->error_code); } diff --git a/ext/pdo/pdo_stmt.stub.php b/ext/pdo/pdo_stmt.stub.php index 3a873b307ebda..207bd3c2e25f6 100644 --- a/ext/pdo/pdo_stmt.stub.php +++ b/ext/pdo/pdo_stmt.stub.php @@ -24,7 +24,7 @@ public function columnCount() {} /** @return bool|null */ public function debugDumpParams() {} - /** @return string|null */ + /** @return string */ public function errorCode() {} /** @return array */ diff --git a/ext/pdo/pdo_stmt_arginfo.h b/ext/pdo/pdo_stmt_arginfo.h index cd3e0549b4527..a7cd771836159 100644 --- a/ext/pdo/pdo_stmt_arginfo.h +++ b/ext/pdo/pdo_stmt_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 3bde9f58b85bc33ff6e4414b7802f42e10e4eab0 */ + * Stub hash: 90e3fbe4a33c7613d279f2942dcd5dc403e68a28 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2) ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL)

« previous php.cvs (#115797) next »