Skip to content

Commit fb69c77

Browse files
committed
PDO MySQL: Use set_row_count() helper
1 parent 8d268e8 commit fb69c77

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

ext/pdo_mysql/mysql_statement.c

+2-9
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */
113113

114114
static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt) /* {{{ */
115115
{
116-
zend_long row_count;
117116
pdo_mysql_stmt *S = stmt->driver_data;
118-
row_count = (zend_long) mysql_stmt_affected_rows(S->stmt);
117+
zend_long row_count = (zend_long) mysql_stmt_affected_rows(S->stmt);
119118
if (row_count != (zend_long)-1) {
120119
stmt->row_count = row_count;
121120
}
@@ -343,9 +342,6 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
343342
{
344343
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
345344
pdo_mysql_db_handle *H = S->H;
346-
#ifdef PDO_USE_MYSQLND
347-
zend_long row_count;
348-
#endif
349345
PDO_DBG_ENTER("pdo_mysql_stmt_next_rowset");
350346
PDO_DBG_INF_FMT("stmt=%p", S->stmt);
351347

@@ -390,10 +386,7 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
390386
}
391387
}
392388
}
393-
row_count = (zend_long) mysql_stmt_affected_rows(S->stmt);
394-
if (row_count != (zend_long)-1) {
395-
stmt->row_count = row_count;
396-
}
389+
pdo_mysql_stmt_set_row_count(stmt);
397390
PDO_DBG_RETURN(1);
398391
}
399392
#endif

0 commit comments

Comments
 (0)