Skip to content

Commit

Permalink
Revert more
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias committed Sep 13, 2020
1 parent 00f450a commit 15f2f4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions ext/mysqli/mysqli_api.c
Expand Up @@ -2255,13 +2255,14 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);

if (mode_in < 0) {
zend_argument_value_error(ERROR_ARG_POS(3), "must be greater than or equal to 0");
RETURN_THROWS();
}

switch (attr) {
#if MYSQL_VERSION_ID >= 50107
case STMT_ATTR_UPDATE_MAX_LENGTH:
if (mode_in < 0) {
zend_argument_value_error(ERROR_ARG_POS(3), "must be 0 or 1 for attribute MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH");
RETURN_THROWS();
}
mode_b = (my_bool) mode_in;
mode_p = &mode_b;
break;
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/tests/mysqli_stmt_attr_set.phpt
Expand Up @@ -257,7 +257,7 @@ require_once("connect.inc");
--EXPECT--
Error: mysqli_stmt object is not fully initialized
mysqli_stmt_attr_set(): Argument #2 ($attr) must be one of MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, MYSQLI_STMT_ATTR_PREFETCH_ROWS, or STMT_ATTR_CURSOR_TYPE
mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be 0 or 1 for attribute MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH
mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be greater than or equal to 0
bool(true)
mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be one of MYSQLI_CURSOR_TYPE_NO_CURSOR, MYSQLI_CURSOR_TYPE_READ_ONLY, MYSQLI_CURSOR_TYPE_FOR_UPDATE, or MYSQLI_CURSOR_TYPE_SCROLLABLE for attribute MYSQLI_STMT_ATTR_CURSOR_TYPE
mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be greater than 0 for attribute MYSQLI_STMT_ATTR_PREFETCH_ROWS
Expand Down

0 comments on commit 15f2f4b

Please sign in to comment.