Problem/Motivation

There is quite some duplicated or nearly duplicated code in StatementWrapperIterator and StatementPrefetchIterator.

One common base class that would be a parent of both of these will help removing the duplication.

It would also make alternative implementations easier, like the one needed for mysqli in #3259709: Create the database driver for MySQLi.

Steps to reproduce

Introduce an abstract StatementBase class, common to both StatementWrapperIterator and StatementPrefetchIterator classes. Also introduce helper classes to manage results of execution statements, to cover PDO and prefetched. This will make the mysqli statement class very small, and the mysqli result class be managed via our own result class.

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3488467

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Issue summary: View changes
mondrake’s picture

Title: [PP-1] Introduce a StatementBase abstract class » Introduce a StatementBase abstract class
Status: Postponed » Active
mondrake’s picture

Assigned: Unassigned » mondrake
andypost’s picture

Status: Active » Needs review
mondrake’s picture

Status: Needs review » Needs work

Not ready yet.

mondrake’s picture

mondrake’s picture

Assigned: mondrake » Unassigned
Status: Needs work » Needs review

Ready for review - thanks!

mondrake’s picture

Issue summary: View changes
daffie’s picture

Issue summary: View changes
Status: Needs review » Needs work
mondrake’s picture

Status: Needs work » Needs review

Thanks @daffie for your review. Fixed your points and answered your question.

mondrake’s picture

I have refreshed #3259709: Create the database driver for MySQLi MR!11355 with the latest changes here - I suggest when reviewing this also seeing that one for how a new implementation of this looks.

daffie’s picture

Status: Needs review » Reviewed & tested by the community

I have reviewed the code changes and they look good.
My question has been answered.
There is already a lot of testing in core.
The change for a BC break is very small. Very unlikely.
For me it is RTBC.

  • catch committed f04c2419 on 11.x
    Issue #3488467 by mondrake, daffie: Introduce a StatementBase abstract...
catch’s picture

Status: Reviewed & tested by the community » Fixed

This looks good to me, couldn't find anything to complain about. Committed/pushed to 11.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.