diff --git a/core/includes/common.inc b/core/includes/common.inc
index 8444244..150d40a 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -1502,7 +1502,9 @@ function drupal_flush_all_caches() {
   foreach ($theme_handler->listInfo() as $theme_name => $theme) {
     $keys[] = 'theme.active_theme.' . $theme_name;
   }
-  \Drupal::state()->deleteMultiple($keys);
+  if (!empty($keys)) {
+    \Drupal::state()->deleteMultiple($keys);
+  }
   // In case the active theme gets requested later in the same request we need
   // to reset the theme manager.
   \Drupal::theme()->resetActiveTheme();
diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
index b1144e4..ee76029 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
@@ -202,11 +202,11 @@ protected function doSet($cid, $data, $expire, $tags) {
    * {@inheritdoc}
    */
   public function setMultiple(array $items) {
-    // Use a transaction so that the database can write the changes in a single
-    // commit.
-    $transaction = $this->connection->startTransaction();
-
-    try {
+//    // Use a transaction so that the database can write the changes in a single
+//    // commit.
+//    $transaction = $this->connection->startTransaction();
+//
+//    try {
       // Delete all items first so we can do one insert. Rather than multiple
       // merge queries.
       $this->deleteMultiple(array_keys($items));
@@ -247,12 +247,12 @@ public function setMultiple(array $items) {
       }
 
       $query->execute();
-    }
-    catch (\Exception $e) {
-      $transaction->rollback();
-      // @todo Log something here or just re throw?
-      throw $e;
-    }
+//    }
+//    catch (\Exception $e) {
+//      $transaction->rollback();
+//      // @todo Log something here or just re throw?
+//      throw $e;
+//    }
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
index 64e1511..7e57897 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
+++ b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
@@ -80,8 +80,9 @@ public static function open(array &$connection_options = array()) {
       // rows that actually didn't have to be updated because the values didn't
       // change. This matches common behavior among other database systems.
       \PDO::MYSQL_ATTR_FOUND_ROWS => TRUE,
-      // Because MySQL's prepared statements skip the query cache, because it's dumb.
-      \PDO::ATTR_EMULATE_PREPARES => TRUE,
+      // Letting MySQL prepare the statement is safer and, on modern versions,
+      // uses the query cache.
+      \PDO::ATTR_EMULATE_PREPARES => FALSE,
     );
 
     $pdo = new \PDO($dsn, $connection_options['username'], $connection_options['password'], $connection_options['pdo']);
diff --git a/core/lib/Drupal/Core/Menu/MenuTreeStorage.php b/core/lib/Drupal/Core/Menu/MenuTreeStorage.php
index 5d1edb9..136cbba 100644
--- a/core/lib/Drupal/Core/Menu/MenuTreeStorage.php
+++ b/core/lib/Drupal/Core/Menu/MenuTreeStorage.php
@@ -283,8 +283,8 @@ protected function doSave(array $link) {
     //   https://www.drupal.org/node/2302137
     $affected_menus = array();
 
-    $transaction = $this->connection->startTransaction();
-    try {
+//    $transaction = $this->connection->startTransaction();
+//    try {
       if ($original) {
         $link['mlid'] = $original['mlid'];
         $link['has_children'] = $original['has_children'];
@@ -308,11 +308,11 @@ protected function doSave(array $link) {
         $this->updateParentalStatus($original);
       }
       $this->updateParentalStatus($link);
-    }
-    catch (\Exception $e) {
-      $transaction->rollback();
-      throw $e;
-    }
+//    }
+//    catch (\Exception $e) {
+//      $transaction->rollback();
+//      throw $e;
+//    }
     return $affected_menus;
   }
 
