Problem/Motivation

The current minimum required version for SQLite (3.3.7) is 9 years old and we need to maintain some special-casing code for that reason.

Proposed resolution

Upgrade the minimum version requirement to 3.6.8.

CentOS 6 has 3.6.20
Debian Wheezy has 3.7.13
Ubuntu 12.04 has 3.7.9

Remaining tasks

None.

User interface changes

None.

API changes

None.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because the current code presumably works.
Prioritized changes The main goal of this issue is to reduce code fragility and future maintenance costs.
Disruption None because D8 is not currently usable with the SQLite db backend.

Comments

amateescu’s picture

Status: Active » Needs review
StatusFileSize
new5.93 KB
new8.8 KB

Patch and a test run for the Database group attached. Note that ConnectionUnitTest is being fixed in #2463321: Serializing the database connection is dangerous and error-prone, make it unserializable again.

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

Are there any security releases in nine years? That would make this more than normal.

amateescu’s picture

Apparently, SQLite never had any security release... that's quite impressive :)

http://www.cvedetails.com/vulnerability-list/vendor_id-9237/Sqlite.html has only 4 entries and neither of them is a vulnerability in SQLite itself. I also can't find anything in http://www.sqlite.org/changes.html.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

This issue is a normal task so we need to outline how it fits within the allowable Drupal 8 beta criteria. Can someone add Drupal 8 beta phase evaluation template to the issue summary.

+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php
@@ -10,24 +10,6 @@
 use Drupal\Core\Database\Query\Delete as QueryDelete;
 
 /**
- * SQLite specific implementation of DeleteQuery.
- *
- * When the WHERE is omitted from a DELETE statement and the table being deleted
- * has no triggers, SQLite uses an optimization to erase the entire table content
- * without having to visit each row of the table individually.
- *
- * Prior to SQLite 3.6.5, SQLite does not return the actual number of rows deleted
- * by that optimized "truncate" optimization.
+ * SQLite specific implementation of \Drupal\Core\Database\Query\Delete.
  */
-class Delete extends QueryDelete {
-  public function execute() {
-    if (!count($this->condition)) {
-      $total_rows = $this->connection->query('SELECT COUNT(*) FROM {' . $this->connection->escapeTable($this->table) . '}')->fetchField();
-      parent::execute();
-      return $total_rows;
-    }
-    else {
-      return parent::execute();
-    }
-  }
-}
+class Delete extends QueryDelete { }

Can't we just delete the entire class then?

amateescu’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs issue summary update

Can't we just delete the entire class then?

Nope, all drivers have to provide empty class implementations for each abstracted db operation, see http://cgit.drupalcode.org/drupal/tree/core/lib/Drupal/Core/Database/Dri... for example.

Added a beta evaluation.

amateescu’s picture

Title: Update SQLite minimun version requirement to 3.6.20 » Raise the minimun version requirement for SQLite to 3.6.20
webchick’s picture

Assigned: Unassigned » alexpott

Seems fine to me. Back to Alex.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Thinking about this I think we shouldn't be in the habit of requiring things we don't need - we had issues with PHPUnit requiring the latest version of PHP for no reason so we shouldn't do the same to other projects. Let's make the requirement 3.6.8 unless there is a compelling reason that we want 3.6.20 - and if there is we should document it. One valid reason to bump it to 3.7.9 might be because that's what DrupalCI will test it on - but that should be in another issue once we have sqlite testing.

amateescu’s picture

Title: Raise the minimun version requirement for SQLite to 3.6.20 » Raise the minimun version requirement for SQLite to 3.6.8
Issue summary: View changes
Status: Needs work » Reviewed & tested by the community
StatusFileSize
new5.92 KB
new470 bytes

I agree with the reasoning from #8.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 561834c and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary.

  • alexpott committed 561834c on 8.0.x
    Issue #2465221 by amateescu: Raise the minimun version requirement for...
larowlan’s picture

Status: Fixed » Needs work

So, it turns out that there *are* security issues in sqllite, that were fixed in 3.8.9 but they just didn't publicize it *or* provide CVEs

See http://seclists.org/fulldisclosure/2015/Apr/31

So should we bump that far or are the issues identified not worth worrying about?

webchick’s picture

Hm. 3.8.9 isn't in any of the distros mentioned in the issue summary, so that seems like it'd make it significantly harder for users.

larowlan’s picture

Yeah... so maybe that's back to fixed - just wanted to get @amateescu's opinion.

alexpott’s picture

I think that our minimum dependency should relate to which features we need - not the security status of the release. We might want to recommend that users use 3.8.9 and above though.

amateescu’s picture

Status: Needs work » Fixed

Yep, IMO it's the job of distributions to apply security patches to (very old) packages they ship.

Status: Fixed » Closed (fixed)

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