dev/core#1747 don't drop temp tables on class destruct.
authoreileen <emcnaughton@wikimedia.org>
Sun, 31 May 2020 23:21:01 +0000 (11:21 +1200)
committereileen <emcnaughton@wikimedia.org>
Sun, 31 May 2020 23:21:01 +0000 (11:21 +1200)
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

index 695d98b426b25cf5f0b2330c5e7e9bb68e74053e..8fca291f52b2822e877caebc0dd4c3d06a682d20 100644 (file)
@@ -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
    */