~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_rkey.c

Removed/replaced DBUG

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
  uint pack_key_length, use_key_length, nextflag;
31
31
  uint myisam_search_flag;
32
32
  int res= 0;
33
 
  DBUG_ENTER("mi_rkey");
34
 
  DBUG_PRINT("enter", ("base: 0x%lx  buf: 0x%lx  inx: %d  search_flag: %d",
35
 
                       (long) info, (long) buf, inx, search_flag));
36
33
 
37
34
  if ((inx = _mi_check_index(info,inx)) < 0)
38
 
    DBUG_RETURN(my_errno);
 
35
    return(my_errno);
39
36
 
40
37
  info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
41
38
  info->last_key_func= search_flag;
55
52
  }
56
53
  else
57
54
  {
58
 
    DBUG_ASSERT(keypart_map);
 
55
    assert(keypart_map);
59
56
    /* Save the packed key for later use in the second buffer of lastkey. */
60
57
    key_buff=info->lastkey+info->s->base.max_key_length;
61
58
    pack_key_length=_mi_pack_key(info,(uint) inx, key_buff, (uchar*) key,
64
61
    info->pack_key_length= pack_key_length;
65
62
    info->last_used_keyseg= (uint16) (last_used_keyseg -
66
63
                                      info->s->keyinfo[inx].seg);
67
 
    DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg,
68
 
                                     key_buff, pack_key_length););
69
64
  }
70
65
 
71
66
  if (fast_mi_readinfo(info))
140
135
        info->lastpos= HA_OFFSET_ERROR;
141
136
        if (share->concurrent_insert)
142
137
          rw_unlock(&share->key_root_lock[inx]);
143
 
        DBUG_RETURN((my_errno= HA_ERR_KEY_NOT_FOUND));
 
138
        return((my_errno= HA_ERR_KEY_NOT_FOUND));
144
139
      }
145
140
      /*
146
141
        Error if no row found within the data file. (Bug #29838)
167
162
 
168
163
  /* Check if we don't want to have record back, only error message */
169
164
  if (!buf)
170
 
    DBUG_RETURN(info->lastpos == HA_OFFSET_ERROR ? my_errno : 0);
 
165
    return(info->lastpos == HA_OFFSET_ERROR ? my_errno : 0);
171
166
 
172
167
  if (!(*info->read_record)(info,info->lastpos,buf))
173
168
  {
174
169
    info->update|= HA_STATE_AKTIV;              /* Record is read */
175
 
    DBUG_RETURN(0);
 
170
    return(0);
176
171
  }
177
172
 
178
173
  info->lastpos = HA_OFFSET_ERROR;              /* Didn't find key */
186
181
  if (search_flag == HA_READ_AFTER_KEY)
187
182
    info->update|=HA_STATE_NEXT_FOUND;          /* Previous gives last row */
188
183
err:
189
 
  DBUG_RETURN(my_errno);
 
184
  return(my_errno);
190
185
} /* _mi_rkey */