diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php index 05bcde0..53d5360 100644 --- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php +++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php @@ -401,19 +401,16 @@ protected function checksumTags(array $tags) { $query = 'SELECT tag, invalidations, deletions FROM {cachetags} WHERE tag IN (:tags)'; $args = array(':tags' => $query_tags); try { - $result = $this->connection->query($query, $args); + $db_tags = $this->connection->query($query, $args)->fetchAllAssoc('tag', \PDO::FETCH_ASSOC); } catch (\Exception $e) { - // If there was an exception, try to create the table. - if ($this->connection->schema()->ensureTableExists('cachetags', new CachetagSchema())) { - $result = $this->connection->query($query, $args); - } - else { - // Some other failure that we can not recover from. + // If there was an exception and the table exists then the cache + // might be stale and the exception needs to be propagated. + if ($this->connection->schema()->tableExists('cachetags')) { throw $e; } + $db_tags = array(); } - $db_tags = $result->fetchAllAssoc('tag', \PDO::FETCH_ASSOC); $tag_cache += $db_tags; // Fill static cache with empty objects for tags not found in the database.