From 1747bb346e0c29fb463f502c7e924d8cff0f362f Mon Sep 17 00:00:00 2001
From: eileen <emcnaughton@wikimedia.org>
Date: Mon, 1 Jun 2020 11:21:01 +1200
Subject: [PATCH] dev/core#1747 don't drop temp tables on class destruct.

Recent code clean up means the search class is now dropped more quickly - meaning that dropping
these tables in the destructors is too aggressive. Since they are memory tables & temp tables they get
cleaned up anyway I think. We should move this search to an extension that ships with core, not necessarily
enabled on initial install but that is up for discussion
---
 CRM/Contact/Form/Search/Custom/DateAdded.php | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/CRM/Contact/Form/Search/Custom/DateAdded.php b/CRM/Contact/Form/Search/Custom/DateAdded.php
index 695d98b426b..8fca291f52b 100644
--- a/CRM/Contact/Form/Search/Custom/DateAdded.php
+++ b/CRM/Contact/Form/Search/Custom/DateAdded.php
@@ -383,19 +383,6 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C
     return $dao->N;
   }
 
-  public function __destruct() {
-    //drop the temp. tables if they exist
-    if ($this->_igTable && !empty($this->_includeGroups)) {
-      $sql = "DROP TEMPORARY TABLE IF EXISTS {$this->_igTable}";
-      CRM_Core_DAO::executeQuery($sql);
-    }
-
-    if ($this->_xgTable && !empty($this->_excludeGroups)) {
-      $sql = "DROP TEMPORARY TABLE IF EXISTS {$this->_xgTable}";
-      CRM_Core_DAO::executeQuery($sql);
-    }
-  }
-
   /**
    * @param string $tableAlias
    */
-- 
GitLab