From: Kurund Jalmi Date: Mon, 24 Aug 2015 09:25:30 +0000 (+0530) Subject: CRM-16719: switch to actual temporary tables X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1669f7529e09706f1befa4a962c7844d41750e32;p=civicrm-core.git CRM-16719: switch to actual temporary tables --- diff --git a/CRM/Report/Form/ActivitySummary.php b/CRM/Report/Form/ActivitySummary.php index 9d02962fdf..0f4296246b 100644 --- a/CRM/Report/Form/ActivitySummary.php +++ b/CRM/Report/Form/ActivitySummary.php @@ -492,8 +492,7 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { } // create temp table to store main result - //$tempQuery = "CREATE TEMPORARY TABLE {$this->_tempTableName} ( " . implode(',', $dbColumns) . ')'; - $tempQuery = "CREATE TABLE {$this->_tempTableName} ( + $tempQuery = "CREATE TEMPORARY TABLE {$this->_tempTableName} ( id int unsigned NOT NULL AUTO_INCREMENT, " . implode(', ', $dbColumns) . ' , PRIMARY KEY (id))'; CRM_Core_DAO::executeQuery($tempQuery); @@ -515,9 +514,8 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { $sql = "SELECT SUM(activity_civireport.duration) as civicrm_activity_duration_total {$this->_from} {$this->_where} {$this->_groupBy} {$this->_having} {$this->_orderBy} {$this->_limit}"; // create temp table to store duration - //$tempQuery = "CREATE TEMPORARY TABLE {$this->_tempTableName} ( " . implode(',', $dbColumns) . ')'; $this->_tempDurationSumTableName = CRM_Core_DAO::createTempTableName('civicrm_activity'); - $tempQuery = "CREATE TABLE {$this->_tempDurationSumTableName} ( + $tempQuery = "CREATE TEMPORARY TABLE {$this->_tempDurationSumTableName} ( id int unsigned NOT NULL AUTO_INCREMENT, civicrm_activity_duration_total VARCHAR(128), PRIMARY KEY (id))"; CRM_Core_DAO::executeQuery($tempQuery);