~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_rsame.cc

  • Committer: tdavies
  • Date: 2010-10-31 07:38:13 UTC
  • mto: (1897.2.4 merge)
  • mto: This revision was merged to the branch mainline in revision 1899.
  • Revision ID: tdavies@molly-20101031073813-mmu12nqc0bwezxny
struct order_st changed and renamed to c++ class named:Order

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 */
15
 
 
16
 
#include "myisamdef.h"
 
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
15
 
 
16
#include "myisam_priv.h"
 
17
#include <drizzled/util/test.h>
 
18
 
 
19
using namespace drizzled;
17
20
 
18
21
        /*
19
22
        ** Find current row with read on position or read on key
25
28
        */
26
29
 
27
30
 
28
 
int mi_rsame(MI_INFO *info, uchar *record, int inx)
 
31
int mi_rsame(MI_INFO *info, unsigned char *record, int inx)
29
32
{
30
33
  if (inx != -1 && ! mi_is_key_active(info->s->state.key_map, inx))
31
34
  {
32
 
    return(my_errno=HA_ERR_WRONG_INDEX);
 
35
    return(errno=HA_ERR_WRONG_INDEX);
33
36
  }
34
37
  if (info->lastpos == HA_OFFSET_ERROR || info->update & HA_STATE_DELETED)
35
38
  {
36
 
    return(my_errno=HA_ERR_KEY_NOT_FOUND);      /* No current record */
 
39
    return(errno=HA_ERR_KEY_NOT_FOUND); /* No current record */
37
40
  }
38
41
  info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
39
42
 
40
43
  /* Read row from data file */
41
44
  if (fast_mi_readinfo(info))
42
 
    return(my_errno);
 
45
    return(errno);
43
46
 
44
47
  if (inx >= 0)
45
48
  {
46
49
    info->lastinx=inx;
47
50
    info->lastkey_length=_mi_make_key(info,(uint) inx,info->lastkey,record,
48
51
                                      info->lastpos);
49
 
    if (info->s->concurrent_insert)
50
 
      rw_rdlock(&info->s->key_root_lock[inx]);
51
 
    VOID(_mi_search(info,info->s->keyinfo+inx,info->lastkey, USE_WHOLE_KEY,
52
 
                    SEARCH_SAME,
53
 
                    info->s->state.key_root[inx]));
54
 
    if (info->s->concurrent_insert)
55
 
      rw_unlock(&info->s->key_root_lock[inx]);
 
52
    _mi_search(info,info->s->keyinfo+inx,info->lastkey, USE_WHOLE_KEY,
 
53
               SEARCH_SAME,
 
54
               info->s->state.key_root[inx]);
56
55
  }
57
56
 
58
57
  if (!(*info->read_record)(info,info->lastpos,record))
59
58
    return(0);
60
 
  if (my_errno == HA_ERR_RECORD_DELETED)
61
 
    my_errno=HA_ERR_KEY_NOT_FOUND;
62
 
  return(my_errno);
 
59
  if (errno == HA_ERR_RECORD_DELETED)
 
60
    errno=HA_ERR_KEY_NOT_FOUND;
 
61
  return(errno);
63
62
} /* mi_rsame */