Closed (fixed)
Project:
Drupal core
Version:
8.8.x-dev
Component:
database system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2011 at 14:08 UTC
Updated:
4 Apr 2020 at 08:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damien tournoud commentedHere is the quick-fix patch.
Comment #2
dawehnerSeems to look fine for me. This is definitive no api change for d7
Comment #3
chx commentedYeah... quite some oversight for SQLite.
Comment #4
dries commentedCommitted to 7.x and 8.x. I'm marking it back as 'needs work' so we can figure out if we want to remove it in 8.x.
Comment #5
damien tournoud commentedI think we do. Patch attached (it's a big patch).
Comment #6
damien tournoud commentedComment #7
Crell commentedfetchField() is there very deliberately, for DX. fetchColumn() is a badly named method. We have fetchCol(), too, which does something entirely different. Which is which? I wouldn't be able to keep them apart myself, frankly.
fetchField() was added specifically to avoid that confusion. We wanted the "fetch a single field out of every record, that is, the entire column of data" operation. So that got called fetchCol(), we added fetchField() to retrieve an individual field out of a record (basically an alias of fetchColumn()), and although PDO has fetchColumn() nothing in Drupal uses it, quite deliberately.
(Of course, column vs. field is a long-standing question. Sigh.)
So simply removing fetchField() would be a step backward for DX, as well as a non-small API break. I wouldn't support that unless we thought through the other related methods.
Comment #20
daffie commentedComment #21
daffie commented