From 27987af53e45c038b1fbb1ec38914daa82bf3b47 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Sun, 8 Mar 2020 09:20:31 +0000 Subject: [PATCH] =?UTF-8?q?Issue=20#3107155=20by=20catch,=20effulgentsia,?= =?UTF-8?q?=20andypost,=20xjm,=20daffie,=20G=C3=A1bor=20Hojtsy,=20alexpott?= =?UTF-8?q?,=20mondrake:=20Raise=20SQLite=20version=20requirement=20to=203?= =?UTF-8?q?.26=20in=20Drupal=209?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/INSTALL.txt | 2 +- .../Core/Database/Driver/sqlite/Install/Tasks.php | 10 +++++++++- .../Drupal/BuildTests/Framework/Tests/HtRouterTest.php | 6 ++++++ .../tests/Drupal/Tests/Core/Command/QuickStartTest.php | 8 ++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/core/INSTALL.txt b/core/INSTALL.txt index 1b2707da826a..0cb34b897908 100644 --- a/core/INSTALL.txt +++ b/core/INSTALL.txt @@ -57,7 +57,7 @@ Drupal requires: - Percona Server 5.7.8 (or greater) (http://www.percona.com/). Percona Server is a backwards-compatible replacement for MySQL. - PostgreSQL 9.1.2 (or greater) (http://www.postgresql.org/). - - SQLite 3.7.11 (or greater) (http://www.sqlite.org/). + - SQLite 3.26 (or greater) (http://www.sqlite.org/). For more detailed information about Drupal requirements, including a list of PHP extensions and configurations that are required, see "System requirements" diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php index 76616244b718..81bdea39bbb4 100644 --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php @@ -12,6 +12,14 @@ */ class Tasks extends InstallTasks { + /** + * 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'; + /** * {@inheritdoc} */ @@ -28,7 +36,7 @@ public function name() { * {@inheritdoc} */ public function minimumVersion() { - return '3.7.11'; + return static::SQLITE_MINIMUM_VERSION; } /** diff --git a/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php b/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php index f356fe8f6914..c96a0f194744 100644 --- a/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php +++ b/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php @@ -3,10 +3,12 @@ namespace Drupal\BuildTests\Framework\Tests; use Drupal\BuildTests\QuickStart\QuickStartTestBase; +use Drupal\Core\Database\Driver\sqlite\Install\Tasks; /** * @coversDefaultClass \Drupal\BuildTests\Framework\BuildTestBase * @group Build + * @requires extension pdo_sqlite */ class HtRouterTest extends QuickStartTestBase { @@ -14,6 +16,10 @@ class HtRouterTest extends QuickStartTestBase { * @covers ::instantiateServer */ public function testHtRouter() { + if (version_compare(\SQLite3::version()['versionString'], Tasks::SQLITE_MINIMUM_VERSION) < 0) { + $this->markTestSkipped(); + } + $this->copyCodebase(); $this->executeCommand('COMPOSER_DISCARD_CHANGES=true composer install --no-dev --no-interaction'); $this->assertErrorOutputContains('Generating autoload files'); diff --git a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php index 9ba14675dd84..bc219a41d9ed 100644 --- a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php +++ b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\Core\Command; +use Drupal\Core\Database\Driver\sqlite\Install\Tasks; use Drupal\Core\Test\TestDatabase; use Drupal\Tests\BrowserTestBase; use GuzzleHttp\Client; @@ -18,6 +19,7 @@ * * @runTestsInSeparateProcesses * @preserveGlobalState disabled + * @requires extension pdo_sqlite * * @group Command */ @@ -87,6 +89,9 @@ public function testQuickStartCommand() { if (version_compare(phpversion(), DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) { $this->markTestSkipped(); } + if (version_compare(\SQLite3::version()['versionString'], Tasks::SQLITE_MINIMUM_VERSION) < 0) { + $this->markTestSkipped(); + } // Install a site using the standard profile to ensure the one time login // link generation works. @@ -177,6 +182,9 @@ public function testQuickStartInstallAndServerCommands() { if (version_compare(phpversion(), DRUPAL_MINIMUM_SUPPORTED_PHP) < 0) { $this->markTestSkipped(); } + if (version_compare(\SQLite3::version()['versionString'], Tasks::SQLITE_MINIMUM_VERSION) < 0) { + $this->markTestSkipped(); + } // Install a site. $install_command = [ -- GitLab