diff --git a/includes/database/select.inc b/includes/database/select.inc
index 70c03a2..8526ae8 100644
--- a/includes/database/select.inc
+++ b/includes/database/select.inc
@@ -1596,6 +1596,8 @@ class SelectQuery extends Query implements SelectQueryInterface {
   }
 
   public function __clone() {
+    parent::__clone();
+
     // On cloning, also clone the dependent objects. However, we do not
     // want to clone the database connection object as that would duplicate the
     // connection itself.
@@ -1605,6 +1607,11 @@ class SelectQuery extends Query implements SelectQueryInterface {
     foreach ($this->union as $key => $aggregate) {
       $this->union[$key]['query'] = clone($aggregate['query']);
     }
+    foreach ($this->tables as $alias => $table) {
+      if ($table['table'] instanceof SelectQueryInterface) {
+        $this->tables[$alias]['table'] = clone $table['table'];
+      }
+    }
   }
 }
 
