~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/structs.h

Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#ifndef DRIZZLED_STRUCTS_H
24
24
#define DRIZZLED_STRUCTS_H
25
25
 
26
 
#include <drizzled/base.h>
27
 
#include <mysys/definitions.h>
28
 
#include <drizzled/lex_string.h>
 
26
#include "drizzled/base.h"
 
27
#include "drizzled/definitions.h"
 
28
#include "drizzled/lex_string.h"
 
29
#include "drizzled/thr_lock.h"
 
30
 
 
31
namespace drizzled
 
32
{
 
33
 
 
34
namespace internal
 
35
{
 
36
typedef struct st_io_cache IO_CACHE;
 
37
}
29
38
 
30
39
class Table;
31
40
class Field;
32
 
typedef struct st_io_cache IO_CACHE;
33
41
 
34
42
typedef struct st_keyfile_info {        /* used with ha_info() */
35
43
  unsigned char ref[MAX_REFLENGTH];             /* Pointer to current row */
36
44
  unsigned char dupp_ref[MAX_REFLENGTH];        /* Pointer to dupp row */
37
45
  uint32_t ref_length;                  /* Length of ref (1-8) */
38
46
  uint32_t block_size;                  /* index block size */
39
 
  File filenr;                          /* (uniq) filenr for table */
 
47
  int filenr;                           /* (uniq) filenr for table */
40
48
  ha_rows records;                      /* Records i datafilen */
41
49
  ha_rows deleted;                      /* Deleted records */
42
50
  uint64_t data_file_length;            /* Length off data file */
55
63
 
56
64
typedef struct st_key_part_info {       /* Info about a key part */
57
65
  Field *field;
58
 
  uint  offset;                         /* offset in record (from 0) */
59
 
  uint  null_offset;                    /* Offset to null_bit in record */
 
66
  unsigned int  offset;                         /* offset in record (from 0) */
 
67
  unsigned int  null_offset;                    /* Offset to null_bit in record */
60
68
  /* Length of key part in bytes, excluding NULL flag and length bytes */
61
69
  uint16_t length;
62
70
  /*
77
85
 
78
86
 
79
87
typedef struct st_key {
80
 
  uint  key_length;                     /* Tot length of key */
 
88
  unsigned int  key_length;             /* Tot length of key */
81
89
  enum  ha_key_alg algorithm;
82
 
  ulong flags;                          /* dupp key and pack flags */
83
 
  uint  key_parts;                      /* How many key_parts */
 
90
  unsigned long flags;                  /* dupp key and pack flags */
 
91
  unsigned int key_parts;               /* How many key_parts */
84
92
  uint32_t  extra_length;
85
 
  uint  usable_key_parts;               /* Should normally be = key_parts */
 
93
  unsigned int usable_key_parts;        /* Should normally be = key_parts */
86
94
  uint32_t  block_size;
87
95
  KEY_PART_INFO *key_part;
88
96
  char  *name;                          /* Name of key */
117
125
};
118
126
 
119
127
struct st_read_record;                          /* For referense later */
120
 
class SQL_SELECT;
121
128
class Session;
122
 
class handler;
 
129
class Cursor;
 
130
namespace optimizer { class SqlSelect; }
123
131
 
124
132
typedef struct st_read_record {                 /* Parameter to read_record */
125
133
  Table *table;                 /* Head-form */
126
 
  handler *file;
 
134
  Cursor *cursor;
127
135
  Table **forms;                        /* head and ref forms */
128
136
  int (*read_record)(struct st_read_record *);
129
137
  Session *session;
130
 
  SQL_SELECT *select;
 
138
  optimizer::SqlSelect *select;
131
139
  uint32_t cache_records;
132
140
  uint32_t ref_length,struct_length,reclength,rec_cache_size,error_offset;
133
141
  uint32_t index;
135
143
  unsigned char *record;
136
144
  unsigned char *rec_buf;                /* to read field values  after filesort */
137
145
  unsigned char *cache,*cache_pos,*cache_end,*read_positions;
138
 
  IO_CACHE *io_cache;
 
146
  internal::IO_CACHE *io_cache;
139
147
  bool print_error, ignore_not_found_rows;
140
148
  JoinTable *do_insideout_scan;
141
149
} READ_RECORD;
142
150
 
143
 
extern const char *show_comp_option_name[];
144
 
 
145
 
typedef int *(*update_var)(Session *, struct st_mysql_show_var *);
146
 
 
147
 
        /* Bits in form->update */
148
 
#define REG_MAKE_DUPP           1       /* Make a copy of record when read */
149
 
#define REG_NEW_RECORD          2       /* Write a new record if not found */
150
 
#define REG_UPDATE              4       /* Uppdate record */
151
 
#define REG_DELETE              8       /* Delete found record */
152
 
#define REG_PROG                16      /* User is updating database */
153
 
#define REG_CLEAR_AFTER_WRITE   32
154
 
#define REG_MAY_BE_UPDATED      64
155
 
#define REG_AUTO_UPDATE         64      /* Used in D-forms for scroll-tables */
156
 
#define REG_OVERWRITE           128
157
 
#define REG_SKIP_DUP            256
 
151
typedef int *(*update_var)(Session *, struct drizzle_show_var *);
 
152
 
 
153
} /* namespace drizzled */
158
154
 
159
155
        /* Bits in form->status */
160
156
#define STATUS_NO_RECORD        (1+2)   /* Record isn't usably */