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
23
#if TIME_WITH_SYS_TIME
24
# include <sys/time.h>
28
# include <sys/time.h>
34
#include <drizzled/base.h>
35
#include <drizzled/structs.h>
36
#include <drizzled/definitions.h>
37
#include <drizzled/lex_string.h>
38
#include "drizzled/global_charset_info.h"
43
typedef struct st_key KEY;
45
typedef struct st_key_cache KEY_CACHE;
59
/* true is not all entries in the engines[] support 2pc */
61
/* storage engines that registered in this transaction */
64
The purpose of this flag is to keep track of non-transactional
65
tables that were modified in scope of:
66
- transaction, when the variable is a member of
67
Session::transaction.all
68
- top-level statement or sub-statement, when the variable is a
69
member of Session::transaction.stmt
70
This member has the following life cycle:
71
* stmt.modified_non_trans_table is used to keep track of
72
modified non-transactional tables of top-level statements. At
73
the end of the previous statement and at the beginning of the session,
74
it is reset to false. If such functions
75
as mysql_insert, mysql_update, mysql_delete etc modify a
76
non-transactional table, they set this flag to true. At the
77
end of the statement, the value of stmt.modified_non_trans_table
78
is merged with all.modified_non_trans_table and gets reset.
79
* all.modified_non_trans_table is reset at the end of transaction
81
* Since we do not have a dedicated context for execution of a
82
sub-statement, to keep track of non-transactional changes in a
83
sub-statement, we re-use stmt.modified_non_trans_table.
84
At entrance into a sub-statement, a copy of the value of
85
stmt.modified_non_trans_table (containing the changes of the
86
outer statement) is saved on stack. Then
87
stmt.modified_non_trans_table is reset to false and the
88
substatement is executed. Then the new value is merged with the
91
bool modified_non_trans_table;
93
void reset() { no_2pc= false; modified_non_trans_table= false; }
96
typedef struct st_ha_create_information
98
const CHARSET_INFO *table_charset, *default_table_charset;
100
uint64_t auto_increment_value;
101
uint32_t table_options;
102
uint32_t used_fields;
103
enum row_type row_type;
104
drizzled::plugin::StorageEngine *db_type;
105
bool table_existed; /* 1 in create if table existed */
108
typedef struct st_ha_alter_information
110
KEY *key_info_buffer;
112
uint32_t index_drop_count;
113
uint32_t *index_drop_buffer;
114
uint32_t index_add_count;
115
uint32_t *index_add_buffer;
120
typedef struct st_key_create_information
122
enum ha_key_alg algorithm;
128
typedef struct st_ha_check_opt
130
st_ha_check_opt() {} /* Remove gcc warning */
134
typedef struct st_range_seq_if
137
Initialize the traversal of range sequence
141
init_params The seq_init_param parameter
142
n_ranges The number of ranges obtained
143
flags A combination of HA_MRR_SINGLE_POINT, HA_MRR_FIXED_KEY
146
An opaque value to be used as RANGE_SEQ_IF::next() parameter
148
range_seq_t (*init)(void *init_params, uint32_t n_ranges, uint32_t flags);
152
Get the next range in the range sequence
156
seq The value returned by RANGE_SEQ_IF::init()
157
range OUT Information about the next range
160
0 - Ok, the range structure filled with info about the next range
163
uint32_t (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
167
This is a buffer area that the handler can use to store rows.
168
'end_of_used_area' should be kept updated after calls to
169
read-functions so that other parts of the code can use the
170
remaining area (until next read calls is issued).
173
typedef struct st_handler_buffer
175
unsigned char *buffer; /* Buffer one can start using */
176
unsigned char *buffer_end; /* End of buffer */
177
unsigned char *end_of_used_area; /* End of area that was used by handler */
180
#endif /* DRIZZLED_HANDLER_STRUCTS_H */