Details
-
Type:
Bug
-
Status: Done/Fixed
-
Priority:
Trivial
-
Resolution: Won't Fix
-
Affects Version/s: 3.4.5
-
Fix Version/s: 4.4.0
-
Component/s: Core CiviCRM
-
Labels:None
Description
To reproduce:
1. Get a database with enough records for a dedupe check to take a few minutes.
2. Start a dedupe check on a group using the Strict Individual rule.
3. While the dedupe check is running, open a new tab. Add a new individual, with first name, last name, and email address.
4. Instead of a new contact, I get an error:
Database Error Code: Lock wait timeout exceeded; try restarting transaction, 1205
Additional Details:
Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => a515ac9c2796ca0e23adbe92c68fc9fc
[message] => DB Error: a515ac9c2796ca0e23adbe92c68fc9fc
[mode] => 16
[debug_info] => INSERT INTO civicrm_email (contact_id , location_type_id , email , is_primary , is_billing , on_hold , is_bulkmail , signature_text , signature_html ) VALUES ( 115200 , 1 , 'me@example.com' , 1 , 0 , 0 , 0 , NULL , NULL ) [nativecode=1205 ** Lock wait timeout exceeded; try restarting transaction]
[type] => DB_Error
[user_info] => INSERT INTO civicrm_email (contact_id , location_type_id , email , is_primary , is_billing , on_hold , is_bulkmail , signature_text , signature_html ) VALUES ( 115200 , 1 , 'me@example.com' , 1 , 0 , 0 , 0 , NULL , NULL ) [nativecode=1205 ** Lock wait timeout exceeded; try restarting transaction]
[to_string] => [db_error: message="DB Error: a515ac9c2796ca0e23adbe92c68fc9fc" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_email (contact_id , location_type_id , email , is_primary , is_billing , on_hold , is_bulkmail , signature_text , signature_html ) VALUES ( 115200 , 1 , 'me@example.com' , 1 , 0 , 0 , 0 , NULL , NULL ) [nativecode=1205 ** Lock wait timeout exceeded; try restarting transaction]"]
)
Here's the output of MySQL slow query logging for the dedupe:
INSERT INTO dedupe (id1, id2, weight) SELECT t1.contact_id id1, t2.contact_id id2, 15 weight FROM civicrm_email t1 JOIN civicrm_email t2 USING (email) WHERE t1.contact_id < t2.contact_id AND t1.email IS NOT NULL AND (t1.contact_id IN (2,4,9,73,77,118,122,127,140,164,176,205,209,227,230,248,276,277,282,288,294,307,329,330,397,411,448,475,485,511,533,553,576,592,617,639,640,641,647,713,752,839,857,863,874,939,1323,1359,1674,1680,1756,1818,2033,2195,2243,2246,2311,2383,2482,2614,2704,2739,2809,2902,2936,2946,2951,2959,3090,3201,3252 ... many values omitted .... 115160, 115161) OR t2.contact_id IN (2,4,9,73,77,118,122,127 ... many values omitted ... 115160,115161)) GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight);