~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/heap.h

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
  uint32_t max_records;
45
45
  uint64_t data_length;
46
46
  uint64_t index_length;
47
 
  uint reclength;                       /* Length of one record */
 
47
  uint32_t reclength;                   /* Length of one record */
48
48
  int errkey;
49
49
  uint64_t auto_increment;
50
50
} HEAPINFO;
60
60
struct st_level_info
61
61
{
62
62
  /* Number of unused slots in *last_blocks HP_PTRS block (0 for 0th level) */
63
 
  uint free_ptrs_in_block;
 
63
  uint32_t free_ptrs_in_block;
64
64
  
65
65
  /*
66
66
    Maximum number of records that can be 'contained' inside of each element
97
97
{
98
98
  HP_PTRS *root;                        /* Top-level block */ 
99
99
  struct st_level_info level_info[HP_MAX_LEVELS+1];
100
 
  uint levels;                          /* number of used levels */
101
 
  uint records_in_block;                /* Records in one heap-block */
102
 
  uint recbuffer;                       /* Length of one saved record */
 
100
  uint32_t levels;                          /* number of used levels */
 
101
  uint32_t records_in_block;            /* Records in one heap-block */
 
102
  uint32_t recbuffer;                   /* Length of one saved record */
103
103
  uint32_t last_allocated; /* number of records there is allocated space for */
104
104
} HP_BLOCK;
105
105
 
107
107
 
108
108
typedef struct st_hp_keydef             /* Key definition with open */
109
109
{
110
 
  uint flag;                            /* HA_NOSAME | HA_NULL_PART_KEY */
111
 
  uint keysegs;                         /* Number of key-segment */
112
 
  uint length;                          /* Length of key (automatic) */
 
110
  uint32_t flag;                                /* HA_NOSAME | HA_NULL_PART_KEY */
 
111
  uint32_t keysegs;                             /* Number of key-segment */
 
112
  uint32_t length;                              /* Length of key (automatic) */
113
113
  uint8_t algorithm;                    /* HASH / BTREE */
114
114
  HA_KEYSEG *seg;
115
115
  HP_BLOCK block;                       /* Where keys are saved */
123
123
                   const unsigned char *record, unsigned char *recpos);
124
124
  int (*delete_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo,
125
125
                   const unsigned char *record, unsigned char *recpos, int flag);
126
 
  uint (*get_key_length)(struct st_hp_keydef *keydef, const unsigned char *key);
 
126
  uint32_t (*get_key_length)(struct st_hp_keydef *keydef, const unsigned char *key);
127
127
} HP_KEYDEF;
128
128
 
129
129
typedef struct st_heap_columndef              /* column information */
139
139
typedef struct st_heap_dataspace   /* control data for data space */
140
140
{
141
141
  HP_BLOCK block;
142
 
  uint chunk_count;             /* Total chunks ever allocated in this dataspace */
143
 
  uint del_chunk_count;         /* Deleted chunks count */
 
142
  uint32_t chunk_count;             /* Total chunks ever allocated in this dataspace */
 
143
  uint32_t del_chunk_count;         /* Deleted chunks count */
144
144
  unsigned char *del_link;               /* Link to last deleted chunk */
145
 
  uint chunk_length;            /* Total length of one chunk */
146
 
  uint chunk_dataspace_length;  /* Length of payload that will be placed into one chunk */
147
 
  uint offset_status;           /* Offset of the status flag relative to the chunk start */
148
 
  uint offset_link;             /* Offset of the linking pointer relative to the chunk start */
149
 
  uint is_variable_size;          /* Test whether records have variable size and so "next" pointer */
 
145
  uint32_t chunk_length;            /* Total length of one chunk */
 
146
  uint32_t chunk_dataspace_length;  /* Length of payload that will be placed into one chunk */
 
147
  uint32_t offset_status;           /* Offset of the status flag relative to the chunk start */
 
148
  uint32_t offset_link;             /* Offset of the linking pointer relative to the chunk start */
 
149
  uint32_t is_variable_size;          /* Test whether records have variable size and so "next" pointer */
150
150
  uint64_t total_data_length;  /* Total size allocated within this data space */
151
151
} HP_DATASPACE;
152
152
 
159
159
 
160
160
  uint32_t min_records,max_records;     /* Params to open */
161
161
  uint64_t index_length,max_table_size;
162
 
  uint key_stat_version;                /* version to indicate insert/delete */
163
 
  uint records;             /* Actual record (row) count */
164
 
  uint blength;                                     /* used_chunk_count rounded up to 2^n */
165
 
  uint fixed_data_length;     /* Length of record's fixed part, which contains keys and always fits into the first chunk */
166
 
  uint fixed_column_count;  /* Number of columns stored in fixed_data_length */
167
 
  uint changed;
168
 
  uint keys,max_key_length;
169
 
  uint column_count;
170
 
  uint currently_disabled_keys;    /* saved value from "keys" when disabled */
171
 
  uint open_count;
 
162
  uint32_t key_stat_version;                /* version to indicate insert/delete */
 
163
  uint32_t records;             /* Actual record (row) count */
 
164
  uint32_t blength;                                     /* used_chunk_count rounded up to 2^n */
 
165
  uint32_t fixed_data_length;     /* Length of record's fixed part, which contains keys and always fits into the first chunk */
 
166
  uint32_t fixed_column_count;  /* Number of columns stored in fixed_data_length */
 
167
  uint32_t changed;
 
168
  uint32_t keys,max_key_length;
 
169
  uint32_t column_count;
 
170
  uint32_t currently_disabled_keys;    /* saved value from "keys" when disabled */
 
171
  uint32_t open_count;
172
172
 
173
173
  
174
174
  char * name;                  /* Name of "memory-file" */
176
176
  pthread_mutex_t intern_lock;          /* Locking for use with _locking */
177
177
  bool delete_on_close;
178
178
  LIST open_list;
179
 
  uint auto_key;
180
 
  uint auto_key_type;                   /* real type of the auto key segment */
 
179
  uint32_t auto_key;
 
180
  uint32_t auto_key_type;                       /* real type of the auto key segment */
181
181
  uint64_t auto_increment;
182
182
} HP_SHARE;
183
183
 
191
191
  uint32_t current_record,next_block;
192
192
  int lastinx,errkey;
193
193
  int  mode;                            /* Mode of file (READONLY..) */
194
 
  uint opt_flag,update;
 
194
  uint32_t opt_flag,update;
195
195
  unsigned char *lastkey;                       /* Last used key with rkey */
196
196
  unsigned char *recbuf;                         /* Record buffer for rb-tree keys */
197
197
  enum ha_rkey_function last_find_flag;
198
198
  TREE_ELEMENT *parents[MAX_TREE_HEIGHT+1];
199
199
  TREE_ELEMENT **last_pos;
200
 
  uint lastkey_len;
 
200
  uint32_t lastkey_len;
201
201
  bool implicit_emptied;
202
202
  THR_LOCK_DATA lock;
203
203
  LIST open_list;
206
206
 
207
207
typedef struct st_heap_create_info
208
208
{
209
 
  uint auto_key;                        /* keynr [1 - maxkey] for auto key */
210
 
  uint auto_key_type;
211
 
  uint max_chunk_size;
212
 
  uint is_dynamic;  
 
209
  uint32_t auto_key;                        /* keynr [1 - maxkey] for auto key */
 
210
  uint32_t auto_key_type;
 
211
  uint32_t max_chunk_size;
 
212
  uint32_t is_dynamic;  
213
213
  uint64_t max_table_size;
214
214
  uint64_t auto_increment;
215
215
  bool with_auto_increment;
229
229
extern int heap_scan(register HP_INFO *info, unsigned char *record);
230
230
extern int heap_delete(HP_INFO *info,const unsigned char *buff);
231
231
extern int heap_info(HP_INFO *info,HEAPINFO *x,int flag);
232
 
extern int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
233
 
           uint columns, HP_COLUMNDEF *columndef,
234
 
           uint max_key_fieldnr, uint key_part_size,
235
 
           uint reclength, uint keys_memory_size,
 
232
extern int heap_create(const char *name, uint32_t keys, HP_KEYDEF *keydef,
 
233
           uint32_t columns, HP_COLUMNDEF *columndef,
 
234
           uint32_t max_key_fieldnr, uint32_t key_part_size,
 
235
           uint32_t reclength, uint32_t keys_memory_size,
236
236
           uint32_t max_records, uint32_t min_records,
237
237
           HP_CREATE_INFO *create_info, HP_SHARE **share);
238
238