- Issue created by @mondrake
- @mondrake opened merge request.
- Status changed to Needs review
almost 2 years ago 8:16am 9 March 2023 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
I'm satisfied that https://www.sqlite.org/releaselog/3_6_0.html means we can remove
// Remove "table." prefixes. if (preg_match("/^.*\.(.*)$/", $column, $matches)) { $rename_columns[$column] = $matches[1]; $this->columnNames[$k] = $matches[1]; }
but what about
// In some SQLite versions, SELECT DISTINCT(field) will return "(field)" // instead of "field". if (preg_match("/^\((.*)\)$/", $column, $matches)) { $rename_columns[$column] = $matches[1]; $this->columnNames[$k] = $matches[1]; $column = $matches[1]; }
Can we point to when and if this has been fixed?
- Status changed to RTBC
almost 2 years ago 9:41am 9 March 2023 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
The distinct bug was fixed in https://www.drupal.org/project/drupal/issues/340568 → - it was found on sqlite 3.5.9.
I've tested 3.39.5 and it is not happening.
sqlite> .header on sqlite> .mode column sqlite> create table test as select 1 as data; sqlite> insert into test values (2); sqlite> insert into test values (3); sqlite> insert into test values (5); sqlite> insert into test values (5); sqlite> select * from test; data ---- 1 2 3 5 5 sqlite> select distinct(data) from test; data ---- 1 2 3 5
I'm satisfied this is no longer an issue.
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
Also we would have fails on Drupal CI because code in
_dblog_get_message_types()
still works in the same way as what prompted the fix in #340568: Test failures with SQLite 3.5.9 (default on Ubuntu Intrepid) → but now without an error on 3.27 and 3.34. - 🇬🇧United Kingdom alexpott 🇪🇺🌍
/** * Minimum required SQLite version. * * Use to build sqlite library with json1 option for JSON datatype support. * @see https://www.sqlite.org/json1.html */ const SQLITE_MINIMUM_VERSION = '3.26';
3.26 is the minimum version on Drupal 9.5 (it was this way since 9.0.0) so I think we can backport this to 9.5.x too.
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
FYI the
// Remove "table." prefixes.
part of the code was added in #67349: Support SQLite databases → so is as old as our SQLite implementation. - Status changed to Fixed
almost 2 years ago 10:57am 9 March 2023 - 🇬🇧United Kingdom catch
Very nice find, good to be rid of it even if it's a few years later than it needed to be!
Committed/pushed to 10.1.x, cherry-picked to 10.0.x and 9.5.x, thanks!
Automatically closed - issue fixed for 2 weeks with no activity.