laminas / laminas-db

Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations
https://docs.laminas.dev/laminas-db/
BSD 3-Clause "New" or "Revised" License
122 stars 69 forks source link

Ensure that each `Adapter#query()` call produces a new `ResultSet` #211

Closed Ocramius closed 3 years ago

Ocramius commented 3 years ago
Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA no

Description

Fixes #210

In release 2.13.0, and specifically through 586fea1bee0c573944fe798cf667ee979524d993, the CS automation introduced a regression that removed a clone call from our sources: https://github.com/laminas/laminas-db/commit/586fea1bee0c573944fe798cf667ee979524d993#diff-55955428038b9bf948e0383865ab55ceee44aabe8418040d92e9b78814064b0fR198

This clone call is vital, as it binds separate ResultSet objects to separate statements.

This change led to the regression explained by @rutek in #210, where two separate queries would lead to same ResultSet instances, and therefore to incorrect results (and iterator rewind on non-rewindable operator too, as a side-effect)

Ocramius commented 3 years ago

Merging based on received feedback @ https://github.com/laminas/laminas-db/issues/210#issuecomment-922429338

Ocramius commented 3 years ago

Ooof, I merged this to 2.14.0 rather than 2.13.2 😵