Hi!
Where to add wating for another thread in case of duplicate key error:
In maria_write, under err: we have a loop where we add back all the
keys we have changed.
Hm... we will have a big problem if we can't add back an unique key we
just deleted. To be safe, we should probably for now disable
versioning if there is more than one unique key. I will fix and push
that.
Anyway, what you should do:
In ma_write.c:w_search() we have the code:
if ((*keyinfo->get_key)(&tmp_key, page_flag, nod_flag, &keypos))
dup_key_pos= _ma_row_pos_from_key(&tmp_key);
Here you should do:
info->dup_key_trid= _ma_trid_from_key(&tmp_key);
After the the loop 'while ( i-- > 0)' after all keys has been added
back, you should add something like:
if (wait_for_trid(info->dup_key_trid) == DEADLOCK)
save_errno= HA_ERR_LOCK_DEADLOCK;
You should also delete the information in 'KNOWN_BUGS.txt' about the
unique key problem.
Regards,
Monty