diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php index 92142e8..1922e6d 100644 --- a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php @@ -114,6 +114,19 @@ public static function open(array &$connection_options = array()) { return $pdo; } + /** + * {@inheritdoc} + */ + public function serialize() { + // Cleanup the connection, much like __destruct() does it as well. + if ($this->needsCleanup) { + $this->nextIdDelete(); + } + $this->needsCleanup = FALSE; + + return parent::serialize(); + } + public function __destruct() { if ($this->needsCleanup) { $this->nextIdDelete();