~ubuntu-branches/debian/squeeze/mysql-5.1/squeeze

« back to all changes in this revision

Viewing changes to storage/heap/hp_delete.c

  • Committer: Package Import Robot
  • Author(s): Moritz Muehlenhoff
  • Date: 2014-01-14 10:40:30 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20140114104030-44alii0hx3x3g41y
Tags: 5.1.73-1
* New upstream release
  http://dev.mysql.com/doc/relnotes/mysql/5.1/en/news-5-1-73.html
* Update patches
* Disable flaky test rpl.rpl_innodb_bug28430 breaking the build. It's  marked
  as experimental by upstream and the internet is full of reports about it's
  unrelialibity

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000-2002, 2004-200 MySQL AB
 
1
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
14
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA */
15
15
 
16
16
/* remove current record in heap-database */
17
17
 
104
104
int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
105
105
                  const uchar *record, uchar *recpos, int flag)
106
106
{
107
 
  ulong blength,pos2,pos_hashnr,lastpos_hashnr;
 
107
  ulong blength, pos2, pos_hashnr, lastpos_hashnr, key_pos;
108
108
  HASH_INFO *lastpos,*gpos,*pos,*pos3,*empty,*last_ptr;
109
109
  HP_SHARE *share=info->s;
110
110
  DBUG_ENTER("hp_delete_key");
116
116
  last_ptr=0;
117
117
 
118
118
  /* Search after record with key */
119
 
  pos= hp_find_hash(&keyinfo->block,
120
 
                    hp_mask(hp_rec_hashnr(keyinfo, record), blength,
121
 
                            share->records + 1));
 
119
  key_pos= hp_mask(hp_rec_hashnr(keyinfo, record), blength, share->records + 1);
 
120
  pos= hp_find_hash(&keyinfo->block, key_pos);
 
121
 
122
122
  gpos = pos3 = 0;
123
123
 
124
124
  while (pos->ptr_to_rec != recpos)
188
188
      DBUG_RETURN(0);
189
189
    }
190
190
    pos3= pos;                          /* Link pos->next after lastpos */
 
191
    /* 
 
192
      One of elements from the bucket we're scanning is moved to the
 
193
      beginning of the list. Reset search since this element may not have
 
194
      been processed yet. 
 
195
    */
 
196
    if (flag && pos2 == key_pos)
 
197
    {
 
198
      info->current_ptr= 0;
 
199
      info->current_hash_ptr= 0;
 
200
    }
191
201
  }
192
202
  else
193
203
  {