~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/records.h

  • Committer: Brian Aker
  • Date: 2010-05-18 19:36:08 UTC
  • mto: This revision was merged to the branch mainline in revision 1540.
  • Revision ID: brian@gaz-20100518193608-rfqleue8qft98e2r
Additional function -> method for readrecord

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
namespace drizzled
24
24
{
25
25
 
26
 
/**
27
 
  Initialize ReadRecord structure to perform full index scan (in forward
28
 
  direction) using read_record.read_record() interface.
29
 
 
30
 
    This function has been added at late stage and is used only by
31
 
    UPDATE/DELETE. Other statements perform index scans using
32
 
    join_read_first/next functions.
33
 
 
34
 
  @param info         ReadRecord structure to initialize.
35
 
  @param session          Thread handle
36
 
  @param table        Table to be accessed
37
 
  @param print_error  If true, call table->print_error() if an error
38
 
                      occurs (except for end-of-records error)
39
 
  @param idx          index to scan
40
 
*/
41
 
void init_read_record_idx(ReadRecord *info, 
42
 
                          Session *session, 
43
 
                          Table *table,
44
 
                          bool print_error, 
45
 
                          uint32_t idx);
 
26
struct ReadRecord {                     /* Parameter to read_record */
 
27
  Table *table;                 /* Head-form */
 
28
  Cursor *cursor;
 
29
  Table **forms;                        /* head and ref forms */
 
30
  int (*read_record)(ReadRecord *);
 
31
  Session *session;
 
32
  optimizer::SqlSelect *select;
 
33
  uint32_t cache_records;
 
34
  uint32_t ref_length;
 
35
  uint32_t struct_length;
 
36
  uint32_t reclength;
 
37
  uint32_t rec_cache_size;
 
38
  uint32_t error_offset;
 
39
  uint32_t index;
 
40
  unsigned char *ref_pos;                               /* pointer to form->refpos */
 
41
  unsigned char *record;
 
42
  unsigned char *rec_buf;                /* to read field values  after filesort */
 
43
  unsigned char *cache;
 
44
  unsigned char *cache_pos;
 
45
  unsigned char *cache_end;
 
46
  unsigned char *read_positions;
 
47
  internal::IO_CACHE *io_cache;
 
48
  bool print_error;
 
49
  bool ignore_not_found_rows;
 
50
  JoinTable *do_insideout_scan;
 
51
  ReadRecord() :
 
52
    table(NULL),
 
53
    cursor(NULL),
 
54
    forms(0),
 
55
    read_record(0),
 
56
    session(0),
 
57
    select(0),
 
58
    cache_records(0),
 
59
    ref_length(0),
 
60
    struct_length(0),
 
61
    reclength(0),
 
62
    rec_cache_size(0),
 
63
    error_offset(0),
 
64
    index(0),
 
65
    ref_pos(0),
 
66
    record(0),
 
67
    rec_buf(0),
 
68
    cache(0),
 
69
    cache_pos(0),
 
70
    cache_end(0),
 
71
    read_positions(0),
 
72
    io_cache(0),
 
73
    print_error(0),
 
74
    ignore_not_found_rows(0),
 
75
    do_insideout_scan(0)
 
76
  {
 
77
  }
 
78
 
 
79
  virtual ~ReadRecord()
 
80
  { }
46
81
 
47
82
/*
48
83
  init_read_record is used to scan by using a number of different methods.
112
147
    This is the most basic access method of a table using rnd_init,
113
148
    rnd_next and rnd_end. No indexes are used.
114
149
*/
115
 
 
116
 
struct ReadRecord {                     /* Parameter to read_record */
117
 
  Table *table;                 /* Head-form */
118
 
  Cursor *cursor;
119
 
  Table **forms;                        /* head and ref forms */
120
 
  int (*read_record)(ReadRecord *);
121
 
  Session *session;
122
 
  optimizer::SqlSelect *select;
123
 
  uint32_t cache_records;
124
 
  uint32_t ref_length,struct_length,reclength,rec_cache_size,error_offset;
125
 
  uint32_t index;
126
 
  unsigned char *ref_pos;                               /* pointer to form->refpos */
127
 
  unsigned char *record;
128
 
  unsigned char *rec_buf;                /* to read field values  after filesort */
129
 
  unsigned char *cache,*cache_pos,*cache_end,*read_positions;
130
 
  internal::IO_CACHE *io_cache;
131
 
  bool print_error, ignore_not_found_rows;
132
 
  JoinTable *do_insideout_scan;
133
 
 
134
150
  void init_read_record(Session *session, 
135
151
                        Table *reg_form,
136
152
                        optimizer::SqlSelect *select,
138
154
                        bool print_errors);
139
155
 
140
156
  void end_read_record();
 
157
 
 
158
 
 
159
/**
 
160
  Initialize ReadRecord structure to perform full index scan (in forward
 
161
  direction) using read_record.read_record() interface.
 
162
 
 
163
    This function has been added at late stage and is used only by
 
164
    UPDATE/DELETE. Other statements perform index scans using
 
165
    join_read_first/next functions.
 
166
 
 
167
  @param info         ReadRecord structure to initialize.
 
168
  @param session          Thread handle
 
169
  @param table        Table to be accessed
 
170
  @param print_error  If true, call table->print_error() if an error
 
171
                      occurs (except for end-of-records error)
 
172
  @param idx          index to scan
 
173
                    */
 
174
  void init_read_record_idx(Session *session, 
 
175
                            Table *table,
 
176
                            bool print_error, 
 
177
                            uint32_t idx);
141
178
};
142
179
 
143
180
} /* namespace drizzled */