From fb69c7752da78129f25c9b19b222a7aba8452eee Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 9 Dec 2020 15:20:47 +0100 Subject: [PATCH] PDO MySQL: Use set_row_count() helper --- ext/pdo_mysql/mysql_statement.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index a8be36c426..3203f1808a 100644 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -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; } @@ -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); @@ -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 -- 2.40.0