diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php
index 5403611..3b51d8b 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Database\Driver\sqlite;
 
+use Drupal\Core\Database\DatabaseExceptionWrapper;
 use Drupal\Core\Database\Query\Select as QuerySelect;
 
 class Select extends QuerySelect {
@@ -14,4 +15,38 @@ public function forUpdate($set = TRUE) {
     // SQLite does not support FOR UPDATE so nothing to do.
     return $this;
   }
-}
\ No newline at end of file
+
+  /**
+   * {@inheritdoc}
+   */
+  public function execute() {
+    // If validation fails, simply return NULL.
+    // Note that validation routines in preExecute() may throw exceptions instead.
+    if (!$this->preExecute()) {
+      return NULL;
+    }
+
+    $args = $this->getArguments();
+
+    try {
+      $return = $this->connection->query((string) $this, $args, $this->queryOptions);
+    }
+    catch (DatabaseExceptionWrapper $e) {
+      // The database schema might be changed by another process in between the
+      // time that the statement was prepared and the time the statement was
+      // run (e.g. usually happens when running tests). In this case, we need to
+      // re-run the query.
+      // @see http://www.sqlite.org/faq.html#q15
+      if (preg_match('/^SQLSTATE\[HY000\]: General error: 17 database schema has changed/', $e->getMessage())) {
+        $return = $this->connection->query((string) $this, $args, $this->queryOptions);
+      }
+      // Otherwise just rethrow the original exception.
+      else {
+        throw $e;
+      }
+    }
+
+    return $return;
+  }
+
+}
