Comment 16 for bug 673105

Revision history for this message
David Shrewsbury (dshrews) wrote :

I'm more and more convinced that this is related to transactions/statements being rolled back due to lock wait timeouts. For example, this failed statement made it into the transaction log:

SET AUTOCOMMIT=ON /*Generated by THREAD_ID 5*/;

UPDATE `AA` SET `col_int_not_null_key` = 50
WHERE `col_int_key` IN (8)
ORDER BY
   `col_bigint`,`col_bigint_key`,`col_bigint_not_null`,`col_bigint_not_null_key`,`col_char_10`,
   `col_char_1024`,`col_char_1024_key`,`col_char_1024_not_null`,`col_char_1024_not_null_key`,
   `col_char_10_key`,`col_char_10_not_null`,`col_char_10_not_null_key`,`col_enum`,`col_enum_key`,
   `col_enum_not_null`,`col_enum_not_null_key`,`col_int`,`col_int_key`,`col_int_not_null`,
   `col_int_not_null_key`,`col_text`,`col_text_key`,`col_text_not_null`,`col_text_not_null_key`,`pk`
LIMIT 5 /*Generated by THREAD_ID 5*/;

# 2010-11-29T10:17:54 Query: UPDATE `AA` SET `col_int_not_null_key` = 50 WHERE `col_int_key` IN (8) ORDER BY `col_bigint`,`col_bigint_key`,`col_bigint_not_null`,`col_bigint_not_null_key`,`col_char_10`,`col_char_1024`,`col_char_1024_key`,`col_char_1024_not_null`,`col_char_1024_not_null_key`,`col_char_10_key`,`col_char_10_not_null`,`col_char_10_not_null_key`,`col_enum`,`col_enum_key`,`col_enum_not_null`,`col_enum_not_null_key`,`col_i
nt`,`col_int_key`,`col_int_not_null`,`col_int_not_null_key`,`col_text`,`col_text_key`,`col_text_not_null`,`col_text_not_null_key`,`pk` LIMIT 5 /*Generated by THREAD_ID 5*/ failed: 1213 Deadlock found when trying to get lock; try restarting transaction. Further errors of this kind will be suppressed.

My test cases that I've created so far have all handled this error correctly. I do not know what the other mystery factor is that causes it to be handled incorrectly.