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.
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 bigint` ,`col_bigint_ key`,`col_ bigint_ not_null` ,`col_bigint_ not_null_ key`,`col_ char_10` , char_1024` ,`col_char_ 1024_key` ,`col_char_ 1024_not_ null`,` col_char_ 1024_not_ null_key` , char_10_ key`,`col_ char_10_ not_null` ,`col_char_ 10_not_ null_key` ,`col_enum` ,`col_enum_ key`, enum_not_ null`,` col_enum_ not_null_ key`,`col_ int`,`col_ int_key` ,`col_int_ not_null` , int_not_ null_key` ,`col_text` ,`col_text_ key`,`col_ text_not_ null`,` col_text_ not_null_ key`,`pk`
WHERE `col_int_key` IN (8)
ORDER BY
`col_
`col_
`col_
`col_
`col_
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 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.
nt`,`col_
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.