summaryrefslogtreecommitdiff
path: root/ext/mysqli
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli')
-rw-r--r--ext/mysqli/mysqli_nonapi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 5bbb1d3888..c75527ff93 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -1160,7 +1160,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
zval *mysql_link;
zend_long flags = TRANS_START_NO_OPT;
char * name = NULL;
- size_t name_len = -1;
+ size_t name_len = 0;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ls!", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
RETURN_THROWS();
@@ -1170,7 +1170,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
zend_argument_value_error(ERROR_ARG_POS(2), "must be one of the MYSQLI_TRANS_* constants");
RETURN_THROWS();
}
- if (!name_len) {
+ if (name && !name_len) {
zend_argument_value_error(ERROR_ARG_POS(3), "cannot be empty");
RETURN_THROWS();
}