Merge mysql.com:/home/svoj/devel/mysql/BUG27564/mysql-5.0-engines
into mysql.com:/home/svoj/devel/mysql/BUG27564/mysql-5.1-engines mysys/hash.c: Auto merged
This commit is contained in:
commit
4beb79a46e
19
mysys/hash.c
19
mysys/hash.c
@ -593,6 +593,25 @@ my_bool hash_update(HASH *hash, uchar *record, uchar *old_key,
|
||||
previous->next=pos->next; /* unlink pos */
|
||||
|
||||
/* Move data to correct position */
|
||||
if (new_index == empty)
|
||||
{
|
||||
/*
|
||||
At this point record is unlinked from the old chain, thus it holds
|
||||
random position. By the chance this position is equal to position
|
||||
for the first element in the new chain. That means updated record
|
||||
is the only record in the new chain.
|
||||
*/
|
||||
if (empty != idx)
|
||||
{
|
||||
/*
|
||||
Record was moved while unlinking it from the old chain.
|
||||
Copy data to a new position.
|
||||
*/
|
||||
data[empty]= org_link;
|
||||
}
|
||||
data[empty].next= NO_RECORD;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
pos=data+new_index;
|
||||
new_pos_index=hash_rec_mask(hash,pos,blength,records);
|
||||
if (new_index != new_pos_index)
|
||||
|
Loading…
x
Reference in New Issue
Block a user