From 75f1cd780f072723ea3fd2d35fd310dcd359d998 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 22 Sep 2016 06:57:30 +0000 Subject: [PATCH] CRM-18006 Change temporary tables to use InnoDB engine --- CRM/Contact/Form/Search/Custom/Group.php | 8 ++++---- CRM/Contact/Form/Task.php | 2 +- CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php | 2 +- CRM/Dedupe/BAO/RuleGroup.php | 4 ++-- CRM/Export/BAO/Export.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CRM/Contact/Form/Search/Custom/Group.php b/CRM/Contact/Form/Search/Custom/Group.php index 8b889dfd0e..89295c3acd 100644 --- a/CRM/Contact/Form/Search/Custom/Group.php +++ b/CRM/Contact/Form/Search/Custom/Group.php @@ -274,7 +274,7 @@ class CRM_Contact_Form_Search_Custom_Group extends CRM_Contact_Form_Search_Custo $xGroups = 0; } - $sql = "CREATE TEMPORARY TABLE Xg_{$this->_tableName} ( contact_id int primary key) ENGINE=MyISAM"; + $sql = "CREATE TEMPORARY TABLE Xg_{$this->_tableName} ( contact_id int primary key) ENGINE=InnoDB"; CRM_Core_DAO::executeQuery($sql); //used only when exclude group is selected @@ -312,7 +312,7 @@ WHERE gcc.group_id = {$ssGroup->id} $sql = "CREATE TEMPORARY TABLE Ig_{$this->_tableName} ( id int PRIMARY KEY AUTO_INCREMENT, contact_id int, - group_names varchar(64)) ENGINE=MyISAM"; + group_names varchar(64)) ENGINE=InnoDB"; CRM_Core_DAO::executeQuery($sql); @@ -414,7 +414,7 @@ WHERE gcc.group_id = {$ssGroup->id} $xTags = 0; } - $sql = "CREATE TEMPORARY TABLE Xt_{$this->_tableName} ( contact_id int primary key) ENGINE=MyISAM"; + $sql = "CREATE TEMPORARY TABLE Xt_{$this->_tableName} ( contact_id int primary key) ENGINE=InnoDB"; CRM_Core_DAO::executeQuery($sql); //used only when exclude tag is selected @@ -432,7 +432,7 @@ WHERE gcc.group_id = {$ssGroup->id} $sql = "CREATE TEMPORARY TABLE It_{$this->_tableName} ( id int PRIMARY KEY AUTO_INCREMENT, contact_id int, - tag_names varchar(64)) ENGINE=MyISAM"; + tag_names varchar(64)) ENGINE=InnoDB"; CRM_Core_DAO::executeQuery($sql); diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php index 0c6f616d5d..e3b94b6b2d 100644 --- a/CRM/Contact/Form/Task.php +++ b/CRM/Contact/Form/Task.php @@ -142,7 +142,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form { $sql = " DROP TABLE IF EXISTS {$form->_componentTable}"; CRM_Core_DAO::executeQuery($sql); - $sql = "CREATE TABLE {$form->_componentTable} ( contact_id int primary key) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci"; + $sql = "CREATE TABLE {$form->_componentTable} ( contact_id int primary key) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci"; CRM_Core_DAO::executeQuery($sql); } diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php index 1ae3af9e35..81733d0419 100644 --- a/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php +++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php @@ -87,7 +87,7 @@ CREATE TEMPORARY TABLE emails ( contact_id2 int, INDEX(contact_id1), INDEX(contact_id2) - ) ENGINE=MyISAM + ) ENGINE=InnoDB "; CRM_Core_DAO::executeQuery($sql); diff --git a/CRM/Dedupe/BAO/RuleGroup.php b/CRM/Dedupe/BAO/RuleGroup.php index 1e156066ed..ca6b3a884c 100644 --- a/CRM/Dedupe/BAO/RuleGroup.php +++ b/CRM/Dedupe/BAO/RuleGroup.php @@ -194,13 +194,13 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { $tableQueries = $this->tableQuery(); if ($this->params && !$this->noRules) { - $tempTableQuery = "CREATE TEMPORARY TABLE dedupe (id1 int, weight int, UNIQUE UI_id1 (id1)) ENGINE=MyISAM"; + $tempTableQuery = "CREATE TEMPORARY TABLE dedupe (id1 int, weight int, UNIQUE UI_id1 (id1)) ENGINE=InnoDB"; $insertClause = "INSERT INTO dedupe (id1, weight)"; $groupByClause = "GROUP BY id1"; $dupeCopyJoin = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column WHERE "; } else { - $tempTableQuery = "CREATE TEMPORARY TABLE dedupe (id1 int, id2 int, weight int, UNIQUE UI_id1_id2 (id1, id2)) ENGINE=MyISAM"; + $tempTableQuery = "CREATE TEMPORARY TABLE dedupe (id1 int, id2 int, weight int, UNIQUE UI_id1_id2 (id1, id2)) ENGINE=InnoDB"; $insertClause = "INSERT INTO dedupe (id1, id2, weight)"; $groupByClause = "GROUP BY id1, id2"; $dupeCopyJoin = " JOIN dedupe_copy ON dedupe_copy.id1 = t1.column AND dedupe_copy.id2 = t2.column WHERE "; diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index c2f998f7e5..88e440ed23 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -1494,7 +1494,7 @@ CREATE TABLE {$exportTempTable} ( } $sql .= " -) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci +) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci "; CRM_Core_DAO::executeQuery($sql); -- 2.25.1