~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_rsame.c

  • Committer: Brian Aker
  • Date: 2008-07-03 00:14:39 UTC
  • Revision ID: brian@tangent.org-20080703001439-pit0mcl0wk8elxlq
Cleanup of sql-common and mysqldump

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
        */
26
26
 
27
27
 
28
 
int mi_rsame(MI_INFO *info, unsigned char *record, int inx)
 
28
int mi_rsame(MI_INFO *info, uchar *record, int inx)
29
29
{
 
30
  DBUG_ENTER("mi_rsame");
 
31
 
30
32
  if (inx != -1 && ! mi_is_key_active(info->s->state.key_map, inx))
31
33
  {
32
 
    return(my_errno=HA_ERR_WRONG_INDEX);
 
34
    DBUG_RETURN(my_errno=HA_ERR_WRONG_INDEX);
33
35
  }
34
36
  if (info->lastpos == HA_OFFSET_ERROR || info->update & HA_STATE_DELETED)
35
37
  {
36
 
    return(my_errno=HA_ERR_KEY_NOT_FOUND);      /* No current record */
 
38
    DBUG_RETURN(my_errno=HA_ERR_KEY_NOT_FOUND); /* No current record */
37
39
  }
38
40
  info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
39
41
 
40
42
  /* Read row from data file */
41
43
  if (fast_mi_readinfo(info))
42
 
    return(my_errno);
 
44
    DBUG_RETURN(my_errno);
43
45
 
44
46
  if (inx >= 0)
45
47
  {
48
50
                                      info->lastpos);
49
51
    if (info->s->concurrent_insert)
50
52
      rw_rdlock(&info->s->key_root_lock[inx]);
51
 
    _mi_search(info,info->s->keyinfo+inx,info->lastkey, USE_WHOLE_KEY,
52
 
               SEARCH_SAME,
53
 
               info->s->state.key_root[inx]);
 
53
    VOID(_mi_search(info,info->s->keyinfo+inx,info->lastkey, USE_WHOLE_KEY,
 
54
                    SEARCH_SAME,
 
55
                    info->s->state.key_root[inx]));
54
56
    if (info->s->concurrent_insert)
55
57
      rw_unlock(&info->s->key_root_lock[inx]);
56
58
  }
57
59
 
58
60
  if (!(*info->read_record)(info,info->lastpos,record))
59
 
    return(0);
 
61
    DBUG_RETURN(0);
60
62
  if (my_errno == HA_ERR_RECORD_DELETED)
61
63
    my_errno=HA_ERR_KEY_NOT_FOUND;
62
 
  return(my_errno);
 
64
  DBUG_RETURN(my_errno);
63
65
} /* mi_rsame */