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"
45
typedef struct st_key KEY;
46
typedef struct st_key_cache KEY_CACHE;
59
modified_non_trans_table(false)
62
/* true is not all entries in the engines[] support 2pc */
64
/* storage engines that registered in this transaction */
67
The purpose of this flag is to keep track of non-transactional
68
tables that were modified in scope of:
69
- transaction, when the variable is a member of
70
Session::transaction.all
71
- top-level statement or sub-statement, when the variable is a
72
member of Session::transaction.stmt
73
This member has the following life cycle:
74
* stmt.modified_non_trans_table is used to keep track of
75
modified non-transactional tables of top-level statements. At
76
the end of the previous statement and at the beginning of the session,
77
it is reset to false. If such functions
78
as mysql_insert, mysql_update, mysql_delete etc modify a
79
non-transactional table, they set this flag to true. At the
80
end of the statement, the value of stmt.modified_non_trans_table
81
is merged with all.modified_non_trans_table and gets reset.
82
* all.modified_non_trans_table is reset at the end of transaction
84
* Since we do not have a dedicated context for execution of a
85
sub-statement, to keep track of non-transactional changes in a
86
sub-statement, we re-use stmt.modified_non_trans_table.
87
At entrance into a sub-statement, a copy of the value of
88
stmt.modified_non_trans_table (containing the changes of the
89
outer statement) is saved on stack. Then
90
stmt.modified_non_trans_table is reset to false and the
91
substatement is executed. Then the new value is merged with the
94
bool modified_non_trans_table;
96
void reset() { no_2pc= false; modified_non_trans_table= false; }
99
typedef struct st_ha_create_information
101
const CHARSET_INFO *table_charset, *default_table_charset;
103
uint64_t auto_increment_value;
104
uint32_t table_options;
105
uint32_t used_fields;
106
enum row_type row_type;
107
plugin::StorageEngine *db_type;
108
bool table_existed; /* 1 in create if table existed */
111
typedef struct st_ha_alter_information
113
KEY *key_info_buffer;
115
uint32_t index_drop_count;
116
uint32_t *index_drop_buffer;
117
uint32_t index_add_count;
118
uint32_t *index_add_buffer;
123
typedef struct st_key_create_information
125
enum ha_key_alg algorithm;
131
typedef struct st_ha_check_opt
133
st_ha_check_opt() {} /* Remove gcc warning */
137
typedef struct st_range_seq_if
140
Initialize the traversal of range sequence
144
init_params The seq_init_param parameter
145
n_ranges The number of ranges obtained
146
flags A combination of HA_MRR_SINGLE_POINT, HA_MRR_FIXED_KEY
149
An opaque value to be used as RANGE_SEQ_IF::next() parameter
151
range_seq_t (*init)(void *init_params, uint32_t n_ranges, uint32_t flags);
155
Get the next range in the range sequence
159
seq The value returned by RANGE_SEQ_IF::init()
160
range OUT Information about the next range
163
0 - Ok, the range structure filled with info about the next range
166
uint32_t (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
170
This is a buffer area that the handler can use to store rows.
171
'end_of_used_area' should be kept updated after calls to
172
read-functions so that other parts of the code can use the
173
remaining area (until next read calls is issued).
176
typedef struct st_handler_buffer
178
unsigned char *buffer; /* Buffer one can start using */
179
unsigned char *buffer_end; /* End of buffer */
180
unsigned char *end_of_used_area; /* End of area that was used by handler */
183
} /* namespace drizzled */
185
#endif /* DRIZZLED_HANDLER_STRUCTS_H */