From: Máté Kocsis Date: Fri, 10 Apr 2020 15:39:21 +0000 (+0200) Subject: Fix the default value of the $flags parameter of mysqli_begin_transaction() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a72e1cc7ae8c0ca6642b175ef6f10f38c7a2a52;p=php Fix the default value of the $flags parameter of mysqli_begin_transaction() --- diff --git a/ext/mysqli/mysqli.stub.php b/ext/mysqli/mysqli.stub.php index 3675015801..8417225df4 100644 --- a/ext/mysqli/mysqli.stub.php +++ b/ext/mysqli/mysqli.stub.php @@ -19,7 +19,7 @@ class mysqli public function autocommit(bool $mode); /** @return bool */ - public function begin_transaction(int $flags = -1, string $name = UNKNOWN); + public function begin_transaction(int $flags = 0, string $name = UNKNOWN); /** @return bool */ public function change_user(string $user, string $password, ?string $database); @@ -284,7 +284,7 @@ function mysqli_affected_rows(mysqli $mysql_link): int|string {} function mysqli_autocommit(mysqli $mysql_link, bool $mode): bool {} -function mysqli_begin_transaction(mysqli $mysql_link, int $flags = -1, string $name = UNKNOWN): bool {} +function mysqli_begin_transaction(mysqli $mysql_link, int $flags = 0, string $name = UNKNOWN): bool {} function mysqli_change_user(mysqli $mysql_link, string $user, string $password, ?string $database): bool {} diff --git a/ext/mysqli/mysqli_arginfo.h b/ext/mysqli/mysqli_arginfo.h index 8645f0f34f..e40ba8ea09 100644 --- a/ext/mysqli/mysqli_arginfo.h +++ b/ext/mysqli/mysqli_arginfo.h @@ -11,7 +11,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_begin_transaction, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "-1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -30,7 +30,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_close, 0, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) ZEND_END_ARG_INFO() -#define arginfo_mysqli_commit arginfo_mysqli_begin_transaction +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_commit, 0, 1, _IS_BOOL, 0) + ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "-1") + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_connect, 0, 0, mysqli, MAY_BE_NULL|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, host, IS_STRING, 1, "null") @@ -426,7 +430,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_autocommit, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_begin_transaction, 0, 0, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "-1") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -441,7 +445,10 @@ ZEND_END_ARG_INFO() #define arginfo_class_mysqli_close arginfo_class_mysqli_character_set_name -#define arginfo_class_mysqli_commit arginfo_class_mysqli_begin_transaction +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_commit, 0, 0, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "-1") + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +ZEND_END_ARG_INFO() #define arginfo_class_mysqli_connect arginfo_class_mysqli___construct