~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_rfirst.c

  • Committer: Brian Aker
  • Date: 2009-01-24 09:43:35 UTC
  • Revision ID: brian@gir-3.local-20090124094335-6qdtvc35gl5fvivz
Adding in an example singe thread scheduler

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#include "heap_priv.h"
 
16
#include "heapdef.h"
17
17
 
18
18
#include <string.h>
19
 
#include <cassert>
20
 
 
21
 
using namespace drizzled;
22
19
 
23
20
/* Read first record with the current key */
24
21
 
32
29
  {
33
30
    unsigned char *pos;
34
31
 
35
 
    if ((pos = (unsigned char *)tree_search_edge(&keyinfo->rb_tree,
36
 
                                                 info->parents,
37
 
                                                 &info->last_pos,
38
 
                                                 offsetof(TREE_ELEMENT, left))))
 
32
    if ((pos = tree_search_edge(&keyinfo->rb_tree, info->parents,
 
33
                                &info->last_pos, offsetof(TREE_ELEMENT, left))))
39
34
    {
40
35
      memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
41
36
             sizeof(unsigned char*));
56
51
    }
57
52
    else
58
53
    {
59
 
      errno = HA_ERR_END_OF_FILE;
60
 
      return(errno);
 
54
      my_errno = HA_ERR_END_OF_FILE;
 
55
      return(my_errno);
61
56
    }
62
57
    return(0);
63
58
  }
65
60
  {
66
61
    if (!(info->s->records))
67
62
    {
68
 
      errno=HA_ERR_END_OF_FILE;
69
 
      return(errno);
 
63
      my_errno=HA_ERR_END_OF_FILE;
 
64
      return(my_errno);
70
65
    }
71
66
    assert(0); /* TODO fix it */
72
67
    info->current_record=0;