diff --git a/vendor/magento/module-catalog-rule/Model/Indexer/IndexerTableSwapper.php b/vendor/magento/module-catalog-rule/Model/Indexer/IndexerTableSwapper.php
index f99f8c50a7f9a..0ddae74ff0a55 100644
--- a/vendor/magento/module-catalog-rule/Model/Indexer/IndexerTableSwapper.php
+++ b/vendor/magento/module-catalog-rule/Model/Indexer/IndexerTableSwapper.php
@@ -122,4 +122,14 @@ public function swapIndexTables(array $originalTablesNames)
             $this->resourceConnection->getConnection()->dropTable($tableName);
         }
     }
+
+    /**
+     * Cleanup leftover temporary tables
+     */
+    public function __destruct()
+    {
+        foreach ($this->temporaryTables as $tableName) {
+            $this->resourceConnection->getConnection()->dropTable($tableName);
+        }
+    }
 }
