~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/structs.h

  • Committer: Monty Taylor
  • Date: 2008-10-05 01:41:06 UTC
  • Revision ID: monty@inaugust.com-20081005014106-bulqe4kp7i6ipts1
Moved qsort declarations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
/* The old structures from unireg */
22
22
 
23
 
#include <mysys/iocache.h>
24
 
 
25
23
class Table;
26
24
class Field;
27
25
 
28
26
typedef struct st_date_time_format {
29
 
  unsigned char positions[8];
 
27
  uchar positions[8];
30
28
  char  time_separator;                 /* Separator between hour and minute */
31
 
  uint32_t flag;                                /* For future */
 
29
  uint flag;                            /* For future */
32
30
  LEX_STRING format;
33
31
} DATE_TIME_FORMAT;
34
32
 
35
33
 
36
34
typedef struct st_keyfile_info {        /* used with ha_info() */
37
 
  unsigned char ref[MAX_REFLENGTH];             /* Pointer to current row */
38
 
  unsigned char dupp_ref[MAX_REFLENGTH];        /* Pointer to dupp row */
39
 
  uint32_t ref_length;                  /* Length of ref (1-8) */
40
 
  uint32_t block_size;                  /* index block size */
 
35
  uchar ref[MAX_REFLENGTH];             /* Pointer to current row */
 
36
  uchar dupp_ref[MAX_REFLENGTH];        /* Pointer to dupp row */
 
37
  uint ref_length;                      /* Length of ref (1-8) */
 
38
  uint block_size;                      /* index block size */
41
39
  File filenr;                          /* (uniq) filenr for table */
42
40
  ha_rows records;                      /* Records i datafilen */
43
41
  ha_rows deleted;                      /* Deleted records */
82
80
  uint  key_length;                     /* Tot length of key */
83
81
  ulong flags;                          /* dupp key and pack flags */
84
82
  uint  key_parts;                      /* How many key_parts */
85
 
  uint32_t  extra_length;
 
83
  uint  extra_length;
86
84
  uint  usable_key_parts;               /* Should normally be = key_parts */
87
 
  uint32_t  block_size;
 
85
  uint  block_size;
88
86
  enum  ha_key_alg algorithm;
89
87
  KEY_PART_INFO *key_part;
90
88
  char  *name;                          /* Name of key */
122
120
  int (*read_record)(struct st_read_record *);
123
121
  THD *thd;
124
122
  SQL_SELECT *select;
125
 
  uint32_t cache_records;
126
 
  uint32_t ref_length,struct_length,reclength,rec_cache_size,error_offset;
127
 
  uint32_t index;
128
 
  unsigned char *ref_pos;                               /* pointer to form->refpos */
129
 
  unsigned char *record;
130
 
  unsigned char *rec_buf;                /* to read field values  after filesort */
131
 
  unsigned char *cache,*cache_pos,*cache_end,*read_positions;
 
123
  uint cache_records;
 
124
  uint ref_length,struct_length,reclength,rec_cache_size,error_offset;
 
125
  uint index;
 
126
  uchar *ref_pos;                               /* pointer to form->refpos */
 
127
  uchar *record;
 
128
  uchar *rec_buf;                /* to read field values  after filesort */
 
129
  uchar *cache,*cache_pos,*cache_end,*read_positions;
132
130
  IO_CACHE *io_cache;
133
131
  bool print_error, ignore_not_found_rows;
134
132
  struct st_join_table *do_insideout_scan;
166
164
*/
167
165
typedef struct user_resources {
168
166
  /* Maximum number of queries/statements per hour. */
169
 
  uint32_t questions;
 
167
  uint questions;
170
168
  /*
171
169
     Maximum number of updating statements per hour (which statements are
172
170
     updating is defined by sql_command_flags array).
173
171
  */
174
 
  uint32_t updates;
 
172
  uint updates;
175
173
  /* Maximum number of connections established per hour. */
176
 
  uint32_t conn_per_hour;
 
174
  uint conn_per_hour;
177
175
  /* Maximum number of concurrent connections. */
178
 
  uint32_t user_conn;
 
176
  uint user_conn;
179
177
  /*
180
178
     Values of this enum and specified_limits member are used by the
181
179
     parser to store which user limits were specified in GRANT statement.
182
180
  */
183
181
  enum {QUERIES_PER_HOUR= 1, UPDATES_PER_HOUR= 2, CONNECTIONS_PER_HOUR= 4,
184
182
        USER_CONNECTIONS= 8};
185
 
  uint32_t specified_limits;
 
183
  uint specified_limits;
186
184
} USER_RESOURCES;
187
185
 
188
186
 
206
204
  */
207
205
  uint64_t reset_utime;
208
206
  /* Total length of the key. */
209
 
  uint32_t len;
 
207
  uint len;
210
208
  /* Current amount of concurrent connections for this account. */
211
 
  uint32_t connections;
 
209
  uint connections;
212
210
  /*
213
211
     Current number of connections per hour, number of updating statements
214
212
     per hour and total number of statements per hour for this account.
215
213
  */
216
 
  uint32_t conn_per_hour, updates, questions;
 
214
  uint conn_per_hour, updates, questions;
217
215
  /* Maximum amount of resources which account is allowed to consume. */
218
216
  USER_RESOURCES user_resources;
219
217
} USER_CONN;
263
261
    interval_max=    (val == UINT64_MAX) ? val : start + val * incr;
264
262
  }
265
263
  Discrete_interval(uint64_t start, uint64_t val, uint64_t incr) :
266
 
    interval_min(start), interval_values(val),
267
 
    interval_max((val == UINT64_MAX) ? val : start + val * incr),
268
 
    next(NULL)
269
 
  {};
270
 
  Discrete_interval() :
271
 
    interval_min(0), interval_values(0),
272
 
    interval_max(0), next(NULL)
273
 
  {};
 
264
    next(NULL) { replace(start, val, incr); };
 
265
  Discrete_interval() : next(NULL) { replace(0, 0, 0); };
274
266
  uint64_t minimum() const { return interval_min;    };
275
267
  uint64_t values()  const { return interval_values; };
276
268
  uint64_t maximum() const { return interval_max;    };
310
302
    "head" to "tail" then to NULL).
311
303
  */
312
304
  Discrete_interval        *current;
313
 
  uint32_t                  elements; // number of elements
 
305
  uint                  elements; // number of elements
314
306
 
315
307
  /* helper function for copy construct and assignment operator */
316
308
  void copy_(const Discrete_intervals_list& from)
322
314
    }
323
315
  }
324
316
public:
325
 
  Discrete_intervals_list() :
326
 
    head(NULL), tail(NULL),
327
 
    current(NULL), elements(0) {};
328
 
  Discrete_intervals_list(const Discrete_intervals_list& from) :
329
 
    head(NULL), tail(NULL),
330
 
    current(NULL), elements(0)
 
317
  Discrete_intervals_list() : head(NULL), current(NULL), elements(0) {};
 
318
  Discrete_intervals_list(const Discrete_intervals_list& from)
331
319
  {
332
320
    copy_(from);
333
321
  }
334
 
  Discrete_intervals_list& operator=(const Discrete_intervals_list& from)
 
322
  void operator=(const Discrete_intervals_list& from)
335
323
  {
336
324
    empty();
337
325
    copy_(from);
338
 
    return *this;
339
326
  }
340
327
  void empty_no_free()
341
328
  {
365
352
  bool append(Discrete_interval *interval);
366
353
  uint64_t minimum()     const { return (head ? head->minimum() : 0); };
367
354
  uint64_t maximum()     const { return (head ? tail->maximum() : 0); };
368
 
  uint32_t      nb_elements() const { return elements; }
 
355
  uint      nb_elements() const { return elements; }
369
356
};