~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to storage/maria/ma_static.c

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
 
2
 
 
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.
 
6
 
 
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.
 
11
 
 
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 */
 
15
 
 
16
/*
 
17
  Static variables for MARIA library. All definied here for easy making of
 
18
  a shared library
 
19
*/
 
20
 
 
21
#ifndef _global_h
 
22
#include "maria_def.h"
 
23
#include "trnman.h"
 
24
#endif
 
25
 
 
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;
 
42
#else
 
43
ulong maria_concurrent_insert= 0;
 
44
#endif
 
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;
 
48
 
 
49
PAGECACHE maria_pagecache_var;
 
50
PAGECACHE *maria_pagecache= &maria_pagecache_var;
 
51
 
 
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;
 
57
 
 
58
/**
 
59
   @brief when transactionality does not matter we can use this transaction
 
60
 
 
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).
 
64
*/
 
65
TRN dummy_transaction_object;
 
66
 
 
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};
 
69
 
 
70
/*
 
71
  read_vec[] is used for converting between P_READ_KEY.. and SEARCH_
 
72
  Position is , == , >= , <= , > , <
 
73
*/
 
74
 
 
75
uint32 maria_read_vec[]=
 
76
{
 
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 */
 
90
};
 
91
 
 
92
uint32 maria_readnext_vec[]=
 
93
{
 
94
  SEARCH_BIGGER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER,
 
95
  SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_SMALLER
 
96
};