Remove obsolete code from Drupal\sqlite\Driver\Database\sqlite\Statement

Created on 9 March 2023, over 1 year ago

Problem/Motivation

Spin-off from 🐛 Implement statement classes using \Iterator to fix memory usage regression and prevent rewinding Fixed .

Since the very beginning of the support of SQLite in core, 17 years ago: https://www.drupal.org/project/drupal/issues/67349 , the Statement::execute() method includes some code with these comments:

    // In some weird cases, SQLite will prefix some column names by the name
    // of the table. We post-process the data, by renaming the column names
    // using the same convention as MySQL and PostgreSQL.

however, there is absolutely no test coverage for this code, not even with mocks. It's a very low level method, called million of times, doing preg_match() calls on each column name in every query... unless we have a proof that is needed, this is a real performance burden.

I only found reference for the

// Remove "table." prefixes.`

case, in https://www.sqlite.org/releaselog/3_6_0.html (point 5). Apparently this was fixed in SQLite 3.6 in 2008, and we have been doing an useless check for the last 15 years. We have SQLite 3.26 as a minimum now.

Proposed resolution

I propose to remove this that seems just cruft. The entire testsuite runs smoothly without any of this code.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

9.5

Component
SQLite driver 

Last updated 2 months ago

No maintainer
Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024