jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/382533 )
Change subject: Remove temp tables pro-actively.
..
Remove temp tables pro-actively.
These were the only places I could find that I thought we were likely to hit a
moderate number
of times where temp tables are created and not deliberately turned up.
The most prevalent of these was the dedupe one, but that is probably only once
per run.
We could merge https://gerrit.wikimedia.org/r/#/c/380667/ to reduce group cache
table creation & increase the
group cache time out so we rebuild the groups we do use, but those ARE being
dropped
Change-Id: I47a66ed27b36e7f1289f603c9c59db7fade1af72
---
M CRM/Activity/BAO/Activity.php
M CRM/Dedupe/BAO/RuleGroup.php
M CRM/Dedupe/Finder.php
M CRM/Mailing/BAO/Recipients.php
4 files changed, 8 insertions(+), 4 deletions(-)
Approvals:
jenkins-bot: Verified
Ejegg: Looks good to me, approved
diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php
index 84a46cf..ffe8fd1 100644
--- a/CRM/Activity/BAO/Activity.php
+++ b/CRM/Activity/BAO/Activity.php
@@ -1105,7 +1105,8 @@
}
}
}
-
+CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS
{$activityTempTable}");
+CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS
{$activityContactTempTable}");
return $values;
}
diff --git a/CRM/Dedupe/BAO/RuleGroup.php b/CRM/Dedupe/BAO/RuleGroup.php
index b3b0ef1..7557af3 100644
--- a/CRM/Dedupe/BAO/RuleGroup.php
+++ b/CRM/Dedupe/BAO/RuleGroup.php
@@ -133,7 +133,9 @@
* Return the SQL query for dropping the temporary table.
*/
public function tableDropQuery() {
-return 'DROP TEMPORARY TABLE IF EXISTS dedupe';
+CRM_Core_DAO::executeQuery( 'DROP TEMPORARY TABLE IF EXISTS dedupe');
+CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS dedupe_copy");
+CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS dedupe_copy2");
}
/**
diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php
index aa092e4..fd5d1c9 100644
--- a/CRM/Dedupe/Finder.php
+++ b/CRM/Dedupe/Finder.php
@@ -85,7 +85,7 @@
while ($dao->fetch()) {
$dupes[] = array($dao->id1, $dao->id2, $dao->weight);
}
-$dao->query($rgBao->tableDropQuery());
+$rgBao->tableDropQuery();
return $dupes;
}
@@ -156,7 +156,7 @@
$dupes[] = $dao->id;
}
}
-$dao->query($rgBao->tableDropQuery());
+$rgBao->tableDropQuery();
return array_diff($dupes, $except);
}
diff --git a/CRM/Mailing/BAO/Recipients.php b/CRM/Mailing/BAO/Recipients.php
index 27e3918..f5812a7 100644
--- a/CRM/Mailing/BAO/Recipients.php
+++ b/CRM/Mailing/BAO/Recipients.php
@@ -120,6 +120,7 @@
SET mr.mailing_id = $newMailingID
";
CRM_Core_DAO::executeQuery($sql);
+CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS
srcMailing_$sourceMailingId");
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/382533
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I47a66ed27b36e7f1289f603c9c59db7fade1af72
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Eileen
Gerrit-Reviewer: Ejegg
Gerrit-Reviewer: Mepps
Gerrit-Reviewer: jenkins-bot <>
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits