~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/records.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
namespace drizzled
24
24
{
25
25
 
26
 
/**
27
 
  Initialize READ_RECORD 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         READ_RECORD 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(READ_RECORD *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
private:
 
44
  unsigned char *cache;
 
45
public:
 
46
  unsigned char *getCache()
 
47
  {
 
48
    return cache;
 
49
  }
 
50
  unsigned char *cache_pos;
 
51
  unsigned char *cache_end;
 
52
  unsigned char *read_positions;
 
53
  internal::IO_CACHE *io_cache;
 
54
  bool print_error;
 
55
  bool ignore_not_found_rows;
 
56
  JoinTable *do_insideout_scan;
 
57
  ReadRecord() :
 
58
    table(NULL),
 
59
    cursor(NULL),
 
60
    forms(0),
 
61
    read_record(0),
 
62
    session(0),
 
63
    select(0),
 
64
    cache_records(0),
 
65
    ref_length(0),
 
66
    struct_length(0),
 
67
    reclength(0),
 
68
    rec_cache_size(0),
 
69
    error_offset(0),
 
70
    index(0),
 
71
    ref_pos(0),
 
72
    record(0),
 
73
    rec_buf(0),
 
74
    cache(0),
 
75
    cache_pos(0),
 
76
    cache_end(0),
 
77
    read_positions(0),
 
78
    io_cache(0),
 
79
    print_error(0),
 
80
    ignore_not_found_rows(0),
 
81
    do_insideout_scan(0)
 
82
  {
 
83
  }
 
84
 
 
85
  void init()
 
86
  {
 
87
    table= NULL;
 
88
    cursor= NULL;
 
89
    forms= 0;
 
90
    read_record= 0;
 
91
    session= 0;
 
92
    select= 0;
 
93
    cache_records= 0;
 
94
    ref_length= 0;
 
95
    struct_length= 0;
 
96
    reclength= 0;
 
97
    rec_cache_size= 0;
 
98
    error_offset= 0;
 
99
    index= 0;
 
100
    ref_pos= 0;
 
101
    record= 0;
 
102
    rec_buf= 0;
 
103
    cache= 0;
 
104
    cache_pos= 0;
 
105
    cache_end= 0;
 
106
    read_positions= 0;
 
107
    io_cache= 0;
 
108
    print_error= 0;
 
109
    ignore_not_found_rows= 0;
 
110
    do_insideout_scan= 0;
 
111
  }
 
112
 
 
113
  virtual ~ReadRecord()
 
114
  { }
46
115
 
47
116
/*
48
117
  init_read_record is used to scan by using a number of different methods.
112
181
    This is the most basic access method of a table using rnd_init,
113
182
    rnd_next and rnd_end. No indexes are used.
114
183
*/
115
 
void init_read_record(READ_RECORD *info, 
116
 
                      Session *session, 
117
 
                      Table *reg_form,
118
 
                      optimizer::SqlSelect *select,
119
 
                      int use_record_cache, 
120
 
                      bool print_errors);
121
 
 
122
 
void end_read_record(READ_RECORD *info);
 
184
  void init_read_record(Session *session, 
 
185
                        Table *reg_form,
 
186
                        optimizer::SqlSelect *select,
 
187
                        int use_record_cache, 
 
188
                        bool print_errors);
 
189
 
 
190
  void end_read_record();
 
191
 
 
192
 
 
193
/**
 
194
  Initialize ReadRecord structure to perform full index scan (in forward
 
195
  direction) using read_record.read_record() interface.
 
196
 
 
197
    This function has been added at late stage and is used only by
 
198
    UPDATE/DELETE. Other statements perform index scans using
 
199
    join_read_first/next functions.
 
200
 
 
201
  @param info         ReadRecord structure to initialize.
 
202
  @param session          Thread handle
 
203
  @param table        Table to be accessed
 
204
  @param print_error  If true, call table->print_error() if an error
 
205
                      occurs (except for end-of-records error)
 
206
  @param idx          index to scan
 
207
                    */
 
208
  void init_read_record_idx(Session *session, 
 
209
                            Table *table,
 
210
                            bool print_error, 
 
211
                            uint32_t idx);
 
212
 
 
213
  void init_reard_record_sequential();
 
214
 
 
215
  bool init_rr_cache();
 
216
};
123
217
 
124
218
} /* namespace drizzled */
125
219