From 590e3cec9aa8052cfd83f0fada10e2cd9079990a Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 18 Nov 2019 06:45:43 +1100 Subject: [PATCH] dev/core#183 Use standard temporary table name format when creating temporary utf8mb4 temporary table --- CRM/Utils/Check/Component/Env.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/Check/Component/Env.php b/CRM/Utils/Check/Component/Env.php index f46ca4df28..72b327bc2b 100644 --- a/CRM/Utils/Check/Component/Env.php +++ b/CRM/Utils/Check/Component/Env.php @@ -891,8 +891,9 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component { } // Use mysqli_query() to avoid logging an error message. - if (mysqli_query(CRM_Core_DAO::getConnection()->connection, 'CREATE TEMPORARY TABLE civicrm_utf8mb4_test (id VARCHAR(255), PRIMARY KEY(id(255))) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC ENGINE=INNODB')) { - CRM_Core_DAO::executeQuery('DROP TEMPORARY TABLE civicrm_utf8mb4_test'); + $mb4testTableName = CRM_Utils_SQL_TempTable::build()->setCategory('utf8mb4test')->getName(); + if (mysqli_query(CRM_Core_DAO::getConnection()->connection, 'CREATE TEMPORARY TABLE ' . $mb4testTableName . ' (id VARCHAR(255), PRIMARY KEY(id(255))) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC ENGINE=INNODB')) { + CRM_Core_DAO::executeQuery('DROP TEMPORARY TABLE ' . $mb4testTableName); } else { $messages[] = new CRM_Utils_Check_Message( -- 2.25.1