Skip to content

Commit

Permalink
PDO MySQL: Use set_row_count() helper
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Dec 9, 2020
1 parent 8d268e8 commit fb69c77
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions ext/pdo_mysql/mysql_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */

static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt) /* {{{ */
{
zend_long row_count;
pdo_mysql_stmt *S = stmt->driver_data;
row_count = (zend_long) mysql_stmt_affected_rows(S->stmt);
zend_long row_count = (zend_long) mysql_stmt_affected_rows(S->stmt);
if (row_count != (zend_long)-1) {
stmt->row_count = row_count;
}
Expand Down Expand Up @@ -343,9 +342,6 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
{
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
#ifdef PDO_USE_MYSQLND
zend_long row_count;
#endif
PDO_DBG_ENTER("pdo_mysql_stmt_next_rowset");
PDO_DBG_INF_FMT("stmt=%p", S->stmt);

Expand Down Expand Up @@ -390,10 +386,7 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
}
}
}
row_count = (zend_long) mysql_stmt_affected_rows(S->stmt);
if (row_count != (zend_long)-1) {
stmt->row_count = row_count;
}
pdo_mysql_stmt_set_row_count(stmt);
PDO_DBG_RETURN(1);
}
#endif
Expand Down

0 comments on commit fb69c77

Please sign in to comment.