CRM-18683 don't use non transaction-safe function to clear smart group cache.
authoreileenmcnaugton <eileen@fuzion.co.nz>
Sun, 29 May 2016 22:15:44 +0000 (10:15 +1200)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 3 Aug 2016 20:56:47 +0000 (06:56 +1000)
Note that there is a function elsewhere that allows the code to use truncate where there is no transaction.

I have left that possibility for future consideration as there is some debate over whether truncate is faster on all sites

CRM/Contact/BAO/GroupContactCache.php

index cdb781dcbfc311091bf4f48fa15dd801d837e668..dba6976fc1ecc971ea80d49a470e1726e5ade0aa 100644 (file)
@@ -354,7 +354,7 @@ WHERE  id IN ( $groupIDs )
     if (!isset($groupID)) {
       if ($smartGroupCacheTimeout == 0) {
         $query = "
-TRUNCATE civicrm_group_contact_cache
+DELETE FROM civicrm_group_contact_cache
 ";
         $update = "
 UPDATE civicrm_group g