1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_HANDLER_STRUCTS_H
21
#define DRIZZLED_HANDLER_STRUCTS_H
26
#include <drizzled/base.h>
27
#include <drizzled/structs.h>
28
#include <drizzled/definitions.h>
29
#include <drizzled/lex_string.h>
34
typedef struct st_key KEY;
36
typedef struct st_key_cache KEY_CACHE;
42
/* true is not all entries in the engines[] support 2pc */
44
/* storage engines that registered in this transaction */
47
The purpose of this flag is to keep track of non-transactional
48
tables that were modified in scope of:
49
- transaction, when the variable is a member of
50
Session::transaction.all
51
- top-level statement or sub-statement, when the variable is a
52
member of Session::transaction.stmt
53
This member has the following life cycle:
54
* stmt.modified_non_trans_table is used to keep track of
55
modified non-transactional tables of top-level statements. At
56
the end of the previous statement and at the beginning of the session,
57
it is reset to false. If such functions
58
as mysql_insert, mysql_update, mysql_delete etc modify a
59
non-transactional table, they set this flag to true. At the
60
end of the statement, the value of stmt.modified_non_trans_table
61
is merged with all.modified_non_trans_table and gets reset.
62
* all.modified_non_trans_table is reset at the end of transaction
64
* Since we do not have a dedicated context for execution of a
65
sub-statement, to keep track of non-transactional changes in a
66
sub-statement, we re-use stmt.modified_non_trans_table.
67
At entrance into a sub-statement, a copy of the value of
68
stmt.modified_non_trans_table (containing the changes of the
69
outer statement) is saved on stack. Then
70
stmt.modified_non_trans_table is reset to false and the
71
substatement is executed. Then the new value is merged with the
74
bool modified_non_trans_table;
76
void reset() { no_2pc= false; modified_non_trans_table= false; }
79
typedef struct st_ha_create_information
81
const CHARSET_INFO *table_charset, *default_table_charset;
82
LEX_STRING connect_string;
84
const char *data_file_name, *index_file_name;
86
uint64_t max_rows,min_rows;
87
uint64_t auto_increment_value;
88
uint32_t table_options;
89
uint32_t avg_row_length;
91
uint32_t key_block_size;
93
enum row_type row_type;
94
StorageEngine *db_type;
95
uint32_t null_bits; /* NULL bits at start of record */
96
uint32_t options; /* OR of HA_CREATE_ options */
97
uint32_t extra_size; /* length of extra data segment */
98
bool table_existed; /* 1 in create if table existed */
99
bool varchar; /* 1 if table has a VARCHAR */
100
enum ha_choice page_checksum; /* If we have page_checksums */
103
typedef struct st_ha_alter_information
105
KEY *key_info_buffer;
107
uint32_t index_drop_count;
108
uint32_t *index_drop_buffer;
109
uint32_t index_add_count;
110
uint32_t *index_add_buffer;
115
typedef struct st_key_create_information
117
enum ha_key_alg algorithm;
119
LEX_STRING parser_name;
124
typedef struct st_ha_check_opt
126
st_ha_check_opt() {} /* Remove gcc warning */
127
uint32_t flags; /* myisam layer flags (e.g. for myisamchk) */
128
/* Just rebuild based on the defintion of the table */
130
/* new key cache when changing key cache */
131
KEY_CACHE *key_cache;
136
typedef struct st_range_seq_if
139
Initialize the traversal of range sequence
143
init_params The seq_init_param parameter
144
n_ranges The number of ranges obtained
145
flags A combination of HA_MRR_SINGLE_POINT, HA_MRR_FIXED_KEY
148
An opaque value to be used as RANGE_SEQ_IF::next() parameter
150
range_seq_t (*init)(void *init_params, uint32_t n_ranges, uint32_t flags);
154
Get the next range in the range sequence
158
seq The value returned by RANGE_SEQ_IF::init()
159
range OUT Information about the next range
162
0 - Ok, the range structure filled with info about the next range
165
uint32_t (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
169
This is a buffer area that the handler can use to store rows.
170
'end_of_used_area' should be kept updated after calls to
171
read-functions so that other parts of the code can use the
172
remaining area (until next read calls is issued).
175
typedef struct st_handler_buffer
177
unsigned char *buffer; /* Buffer one can start using */
178
unsigned char *buffer_end; /* End of buffer */
179
unsigned char *end_of_used_area; /* End of area that was used by handler */
182
#endif /* DRIZZLED_HANDLER_STRUCTS_H */