From: Tim Otten Date: Fri, 15 Jun 2018 03:52:56 +0000 (-0700) Subject: (dev/core#183) Change temp table naming for CRM/Contact/Form/Search/Custom/ContribSYB... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6ec810cf5ea20fdca0e6a6867ea0a59e7c18c965;p=civicrm-core.git (dev/core#183) Change temp table naming for CRM/Contact/Form/Search/Custom/ContribSYBNT.php Re:`r-run` -- Verified that these lines are executed by the search form -- and that the outcomes of a few basic searches are the same with the patch. --- diff --git a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php index bfd961b1c2..cf2b1e950b 100644 --- a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php +++ b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php @@ -192,10 +192,8 @@ ORDER BY donation_amount desc "; if ($justIDs) { - CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS CustomSearch_SYBNT_temp"); - $query = "CREATE TEMPORARY TABLE CustomSearch_SYBNT_temp AS ({$sql})"; - CRM_Core_DAO::executeQuery($query); - $sql = "SELECT contact_a.id as contact_id FROM CustomSearch_SYBNT_temp as contact_a"; + $tempTable = CRM_Utils_SQL_TempTable::build()->createWithQuery($sql); + $sql = "SELECT contact_a.id as contact_id FROM {$tempTable->getName()} as contact_a"; } return $sql; }