1
/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
Static variables for MARIA library. All definied here for easy making of
22
#include "maria_def.h"
26
LIST *maria_open_list=0;
27
uchar maria_file_magic[]=
28
{ (uchar) 254, (uchar) 254, (uchar) 9, '\003', };
29
uchar maria_pack_file_magic[]=
30
{ (uchar) 254, (uchar) 254, (uchar) 10, '\001', };
31
/* Unique number for this maria instance */
32
uchar maria_uuid[MY_UUID_SIZE];
33
uint maria_quick_table_bits=9;
34
ulong maria_block_size= MARIA_KEY_BLOCK_LENGTH;
35
my_bool maria_flush= 0, maria_single_user= 0;
36
my_bool maria_delay_key_write= 0, maria_page_checksums= 1;
37
my_bool maria_inited= FALSE;
38
my_bool maria_in_ha_maria= FALSE; /* If used from ha_maria or not */
39
pthread_mutex_t THR_LOCK_maria;
40
#if defined(THREAD) && !defined(DONT_USE_RW_LOCKS)
41
ulong maria_concurrent_insert= 2;
43
ulong maria_concurrent_insert= 0;
45
my_off_t maria_max_temp_length= MAX_FILE_SIZE;
46
ulong maria_bulk_insert_tree_size=8192*1024;
47
ulong maria_data_pointer_size= 4;
49
PAGECACHE maria_pagecache_var;
50
PAGECACHE *maria_pagecache= &maria_pagecache_var;
52
PAGECACHE maria_log_pagecache_var;
53
PAGECACHE *maria_log_pagecache= &maria_log_pagecache_var;
54
MY_TMPDIR *maria_tmpdir; /* Tempdir for redo */
55
char *maria_data_root;
56
HASH maria_stored_state;
59
@brief when transactionality does not matter we can use this transaction
61
Used in external programs like ma_test*, and also internally inside
62
libmaria when there is no transaction around and the operation isn't
63
transactional (CREATE/DROP/RENAME/OPTIMIZE/REPAIR).
65
TRN dummy_transaction_object;
67
/* Enough for comparing if number is zero */
68
uchar maria_zero_string[]= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
71
read_vec[] is used for converting between P_READ_KEY.. and SEARCH_
72
Position is , == , >= , <= , > , <
75
uint32 maria_read_vec[]=
77
SEARCH_FIND, /* HA_READ_KEY_EXACT */
78
SEARCH_FIND | SEARCH_BIGGER, /* HA_READ_KEY_OR_NEXT */
79
SEARCH_FIND | SEARCH_SMALLER, /* HA_READ_KEY_OR_PREV */
80
SEARCH_NO_FIND | SEARCH_BIGGER, /* HA_READ_AFTER_KEY */
81
SEARCH_NO_FIND | SEARCH_SMALLER, /* HA_READ_BEFORE_KEY */
82
SEARCH_FIND | SEARCH_PART_KEY, /* HA_READ_PREFIX */
83
SEARCH_LAST, /* HA_READ_PREFIX_LAST */
84
SEARCH_LAST | SEARCH_SMALLER, /* HA_READ_PREFIX_LAST_OR_PREV */
85
MBR_CONTAIN, /* HA_READ_MBR_CONTAIN */
86
MBR_INTERSECT, /* HA_READ_MBR_INTERSECT */
87
MBR_WITHIN, /* HA_READ_MBR_WITHIN */
88
MBR_DISJOINT, /* HA_READ_MBR_DISJOINT */
89
MBR_EQUAL /* HA_READ_MBR_EQUAL */
92
uint32 maria_readnext_vec[]=
94
SEARCH_BIGGER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER,
95
SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_SMALLER