Skip to content

Commit 3292b97

Browse files
kamil-tekielaGirgias
authored andcommitted
Add ZEND_ASSERT to stmt->errorCode
1 parent 9b78000 commit 3292b97

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Diff for: ext/pdo/pdo_stmt.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -1529,9 +1529,7 @@ PHP_METHOD(PDOStatement, errorCode)
15291529
ZEND_PARSE_PARAMETERS_NONE();
15301530

15311531
PHP_STMT_GET_OBJ;
1532-
if (stmt->error_code[0] == '\0') {
1533-
RETURN_NULL();
1534-
}
1532+
ZEND_ASSERT(stmt->error_code[0] != '\0');
15351533

15361534
RETURN_STRING(stmt->error_code);
15371535
}

Diff for: ext/pdo/pdo_stmt.stub.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function columnCount() {}
2424
/** @return bool|null */
2525
public function debugDumpParams() {}
2626

27-
/** @return string|null */
27+
/** @return string */
2828
public function errorCode() {}
2929

3030
/** @return array */

Diff for: ext/pdo/pdo_stmt_arginfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 3bde9f58b85bc33ff6e4414b7802f42e10e4eab0 */
2+
* Stub hash: 90e3fbe4a33c7613d279f2942dcd5dc403e68a28 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2)
55
ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL)

0 commit comments

Comments
 (0)