Hello,
On Sat, Jun 28, 2008 at 05:57:18PM +0300, Michael Widenius wrote:
> 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.
Serg, do you understand: I see nothing about a unique key problem in
KNOWN_BUGS.txt, and I don't see how the wait you would add would
remove such problem, if such problem is the "big problem" above.
In this revision
monty@stripped
Monty disabled versioning if there is more than one unique index, I
think this is all related. Quite a severe limitation in my view,
interesting if Monty's text above suggests that you could lift it.
I'm quite confused myself.
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Guilhem Bichot <guilhem@stripped>
/ /|_/ / // /\ \/ /_/ / /__ MySQL France, Lead Software Engineer
/_/ /_/\_, /___/\___\_\___/ Bordeaux, France
<___/ www.mysql.com