Commit 2bb3bba5 authored by catch's avatar catch

Issue #3043907 by alexpott, dawehner, starlightE, cilefen:...

Issue #3043907 by alexpott, dawehner, starlightE, cilefen: DatabaseCacheBackend::ensureBinExists() does not properly handle exceptions
parent 44ffb271
......@@ -3,7 +3,7 @@
namespace Drupal\Core\Batch;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\DatabaseException;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Drupal\Core\Access\CsrfTokenGenerator;
......@@ -174,7 +174,7 @@ protected function ensureTableExists() {
// If another process has already created the batch table, attempting to
// recreate it will throw an exception. In this case just catch the
// exception and do nothing.
catch (SchemaObjectExistsException $e) {
catch (DatabaseException $e) {
return TRUE;
}
return FALSE;
......
......@@ -5,7 +5,7 @@
use Drupal\Component\Assertion\Inspector;
use Drupal\Component\Utility\Crypt;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\DatabaseException;
/**
* Defines a default cache implementation.
......@@ -410,7 +410,7 @@ protected function ensureBinExists() {
// If another process has already created the cache table, attempting to
// recreate it will throw an exception. In this case just catch the
// exception and do nothing.
catch (SchemaObjectExistsException $e) {
catch (DatabaseException $e) {
return TRUE;
}
return FALSE;
......
......@@ -3,7 +3,7 @@
namespace Drupal\Core\Cache;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\DatabaseException;
/**
* Cache tags invalidations checksum implementation that uses the database.
......@@ -155,7 +155,7 @@ protected function ensureTableExists() {
// If another process has already created the cachetags table, attempting to
// recreate it will throw an exception. In this case just catch the
// exception and do nothing.
catch (SchemaObjectExistsException $e) {
catch (DatabaseException $e) {
return TRUE;
}
return FALSE;
......
......@@ -4,7 +4,7 @@
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\DatabaseException;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
/**
......@@ -169,7 +169,7 @@ protected function ensureTableExists() {
// If another process has already created the config table, attempting to
// recreate it will throw an exception. In this case just catch the
// exception and do nothing.
catch (SchemaObjectExistsException $e) {
catch (DatabaseException $e) {
return TRUE;
}
catch (\Exception $e) {
......
......@@ -2,7 +2,7 @@
namespace Drupal\Core\Flood;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\DatabaseException;
use Symfony\Component\HttpFoundation\RequestStack;
use Drupal\Core\Database\Connection;
......@@ -159,7 +159,7 @@ protected function ensureTableExists() {
// If another process has already created the table, attempting to create
// it will throw an exception. In this case just catch the exception and do
// nothing.
catch (SchemaObjectExistsException $e) {
catch (DatabaseException $e) {
return TRUE;
}
return FALSE;
......
......@@ -4,8 +4,8 @@
use Drupal\Component\Utility\Crypt;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\DatabaseException;
use Drupal\Core\Database\IntegrityConstraintViolationException;
use Drupal\Core\Database\SchemaObjectExistsException;
/**
* Defines the database lock backend. This is the default backend in Drupal.
......@@ -186,7 +186,7 @@ protected function ensureTableExists() {
// If another process has already created the semaphore table, attempting to
// recreate it will throw an exception. In this case just catch the
// exception and do nothing.
catch (SchemaObjectExistsException $e) {
catch (DatabaseException $e) {
return TRUE;
}
return FALSE;
......
......@@ -9,8 +9,8 @@
use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\DatabaseException;
use Drupal\Core\Database\Query\SelectInterface;
use Drupal\Core\Database\SchemaObjectExistsException;
/**
* Provides a menu tree storage using the database.
......@@ -1168,7 +1168,7 @@ protected function ensureTableExists() {
return TRUE;
}
}
catch (SchemaObjectExistsException $e) {
catch (DatabaseException $e) {
// If another process has already created the config table, attempting to
// recreate it will throw an exception. In this case just catch the
// exception and do nothing.
......
......@@ -4,7 +4,7 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\DatabaseException;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Database\Query\Condition;
......@@ -380,7 +380,7 @@ protected function ensureTableExists() {
// If another process has already created the table, attempting to recreate
// it will throw an exception. In this case just catch the exception and do
// nothing.
catch (SchemaObjectExistsException $e) {
catch (DatabaseException $e) {
return TRUE;
}
return FALSE;
......
......@@ -3,7 +3,7 @@
namespace Drupal\Core\Queue;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\DatabaseException;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
/**
......@@ -250,7 +250,7 @@ protected function ensureTableExists() {
// If another process has already created the queue table, attempting to
// recreate it will throw an exception. In this case just catch the
// exception and do nothing.
catch (SchemaObjectExistsException $e) {
catch (DatabaseException $e) {
return TRUE;
}
return FALSE;
......
......@@ -2,7 +2,7 @@
namespace Drupal\Core\Routing;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\DatabaseException;
use Drupal\Core\State\StateInterface;
use Symfony\Component\Routing\RouteCollection;
......@@ -179,7 +179,7 @@ protected function ensureTableExists() {
return TRUE;
}
}
catch (SchemaObjectExistsException $e) {
catch (DatabaseException $e) {
// If another process has already created the config table, attempting to
// recreate it will throw an exception. In this case just catch the
// exception and do nothing.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment