Skip to content

affected_rows incorrect with multi-statements #1411

@basex

Description

@basex

When running multi-statements, the behavior of affected_rows appears to have changed in v0.5.7. The function now always returns the first statement’s affected_rows, instead of reflecting the result of the current statement.

This seems to be caused by #1383

client.query('INSERT INTO roles (store_id, type) VALUES (1, 1), (2, 3); UPDATE roles SET type = 2 WHERE id = 1', as: :array)
client.affected_rows # => 2
client.next_result # => true
client.affected_rows # before was correctly 1, now returns 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions