[regression] fetchAllAssoc() and fetchAllKeyed() behave inconsistently

Created on 25 March 2023, about 1 year ago
Updated 25 April 2023, about 1 year ago

Problem/Motivation

From #3265086-129: Implement statement classes using \Iterator to fix memory usage regression and prevent rewinding .

I noted that StatementWrapperIterator implements fetchAllAssoc() and fetchAllKeyed() incorrectly since they run a foreach loop on the statement itself - which in case a statement is already partially fetched requires a rewind that is not allowed in our implementation. This is not a case for StatementPrefetchIterartor that keeps fetching records while there are available.

IMHO we should fix it to align all fetchAll* methods to the standard PDO fetchAll() behaviour which is

PDOStatement::fetchAll() returns an array containing all of the remaining rows in the result set.

See https://www.php.net/manual/en/pdostatement.fetchall.php#refsect1-pdostat...

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Fixed

Version

10.1

Component
Database 

Last updated 5 days ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024