12
12
You should have received a copy of the GNU General Public License
13
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
16
/* This file is included by all internal myisam files */
18
18
#ifndef PLUGIN_MYISAM_MYISAM_PRIV_H
19
19
#define PLUGIN_MYISAM_MYISAM_PRIV_H
23
22
#include "myisam.h" /* Structs & some defines */
24
23
#include "myisampack.h" /* packing of keys */
25
#include <drizzled/tree.h>
26
#include <drizzled/internal/my_pthread.h>
24
#include "drizzled/tree.h"
25
#include "drizzled/internal/my_pthread.h"
27
26
#include <drizzled/thr_lock.h>
28
27
#include <drizzled/common.h>
29
#include <drizzled/enum.h>
31
29
#include <assert.h>
33
31
#include <string.h>
36
#include <boost/thread/mutex.hpp>
38
34
#if defined(my_write)
39
35
#undef my_write /* undef map from my_nosys; We need test-if-disk full */
42
/* Typical key cash */
43
static const uint32_t KEY_CACHE_SIZE= 8*1024*1024;
45
/* Default size of a key cache block */
46
static const uint32_t KEY_CACHE_BLOCK_SIZE= 1024;
48
38
typedef struct st_mi_status_info
50
40
drizzled::ha_rows records; /* Rows in table */
187
177
char *data_file_name, /* Resolved path names from symlinks */
188
178
*index_file_name;
189
179
unsigned char *file_map; /* mem-map of file if possible */
191
drizzled::KEY_CACHE key_cache; /* ref to the current key cache */
193
drizzled::KEY_CACHE *getKeyCache()
180
drizzled::KEY_CACHE *key_cache; /* ref to the current key cache */
200
181
MI_DECODE_TREE *decode_trees;
201
182
uint16_t *decode_tables;
202
183
int (*read_record)(struct st_myisam_info*, drizzled::internal::my_off_t, unsigned char*);
214
195
ulong this_process; /* processid */
215
196
ulong last_process; /* For table-change-check */
216
197
ulong last_version; /* Version on start */
217
uint64_t options; /* Options used */
198
ulong options; /* Options used */
218
199
ulong min_pack_length; /* Theese are used by packed data */
219
200
ulong max_pack_length;
220
201
ulong state_diff_length;
237
218
temporary,delay_key_write,
238
219
concurrent_insert;
220
drizzled::THR_LOCK lock;
221
pthread_mutex_t intern_lock; /* Locking for use with _locking */
222
pthread_rwlock_t *key_root_lock;
239
223
drizzled::internal::my_off_t mmaped_length;
240
224
uint32_t nonmmaped_inserts; /* counter of writing in non-mmaped
226
pthread_rwlock_t mmap_lock;
474
459
#define MI_UNIQUE_HASH_TYPE HA_KEYTYPE_ULONG_INT
475
460
#define mi_unique_store(A,B) mi_int4store((A),(B))
477
extern boost::mutex THR_LOCK_myisam;
462
extern pthread_mutex_t THR_LOCK_myisam;
479
464
/* Some extern variables */
688
673
int file, drizzled::internal::my_off_t filepos);
689
674
extern void _my_store_blob_length(unsigned char *pos,uint32_t pack_length,uint32_t length);
690
675
extern void mi_report_error(int errcode, const char *file_name);
691
extern void mi_report_error(drizzled::error_t errcode, const char *file_name);
692
676
extern size_t mi_mmap_pread(MI_INFO *info, unsigned char *Buffer,
693
677
size_t Count, drizzled::internal::my_off_t offset, drizzled::myf MyFlags);
694
678
extern size_t mi_mmap_pwrite(MI_INFO *info, const unsigned char *Buffer,
720
704
const unsigned char *record, drizzled::internal::my_off_t pos);
721
705
int mi_unique_comp(MI_UNIQUEDEF *def, const unsigned char *a, const unsigned char *b,
722
706
bool null_are_equal);
707
void mi_get_status(void* param, int concurrent_insert);
708
void mi_update_status(void* param);
709
void mi_restore_status(void* param);
710
void mi_copy_status(void* to,void *from);
711
bool mi_check_status(void* param);
724
713
extern MI_INFO *test_if_reopen(char *filename);
725
714
bool check_table_is_closed(const char *name, const char *where);