Skip to content

Commit

Permalink
Remove unnecessary more_results() checks
Browse files Browse the repository at this point in the history
Just calling next_result() is sufficient.
  • Loading branch information
nikic committed Dec 9, 2020
1 parent a073b02 commit ef342b0
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions ext/pdo_mysql/mysql_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,6 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */

#ifdef PDO_USE_MYSQLND
if (!H->emulate_prepare) {
if (!mysqlnd_stmt_more_results(S->stmt)) {
PDO_DBG_RETURN(0);
}
if (mysqlnd_stmt_next_result(S->stmt)) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
Expand All @@ -375,25 +372,12 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
}
#endif

if (!mysql_more_results(H->server)) {
/* No more results */
PDO_DBG_RETURN(0);
}
#ifdef PDO_USE_MYSQLND
if (mysql_next_result(H->server) == FAIL) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
} else {
PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt));
}
#else
if (mysql_next_result(H->server) > 0) {
if (mysql_next_result(H->server)) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
} else {
PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt));
}
#endif
}
/* }}} */

Expand Down

0 comments on commit ef342b0

Please sign in to comment.