Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use iterated struct and remove dulicate SET_AFFECTED_ROWS
  • Loading branch information
kamil-tekiela committed Apr 10, 2026
commit eec86c550752a9a0409e6432af868457a0a4ac11
9 changes: 3 additions & 6 deletions ext/mysqlnd/mysqlnd_result.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,6 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c

if (ret == FAIL) {
COPY_CLIENT_ERROR(&set->error_info, row_packet.error_info);
} else {
/* libmysql's documentation says it should be so for SELECT statements */
UPSERT_STATUS_SET_AFFECTED_ROWS(conn->upsert_status, set->row_count);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? I don't see how this is set elsewhere

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After each time this method is called, the caller sets it.

}
DBG_INF_FMT("ret=%s row_count=%u warnings=%u server_status=%u",
ret == PASS? "PASS":"FAIL",
Expand Down Expand Up @@ -1012,10 +1009,10 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const unsigned int
hashing of the column name, which is not needed as it can be precomputed.
*/
Z_TRY_ADDREF_P(data);
if (meta->fields[i].is_numeric == FALSE) {
zend_hash_update(row_ht, meta->fields[i].sname, data);
if (field->is_numeric == FALSE) {
zend_hash_update(row_ht, field->sname, data);
} else {
zend_hash_index_update(row_ht, meta->fields[i].num_key, data);
zend_hash_index_update(row_ht, field->num_key, data);
}
}

Expand Down
Loading