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