20
20
#ifndef DRIZZLED_HANDLER_STRUCTS_H
21
21
#define DRIZZLED_HANDLER_STRUCTS_H
23
#if TIME_WITH_SYS_TIME
24
# include <sys/time.h>
28
# include <sys/time.h>
34
26
#include <drizzled/base.h>
35
27
#include <drizzled/structs.h>
36
28
#include <drizzled/definitions.h>
37
29
#include <drizzled/lex_string.h>
38
#include "drizzled/global_charset_info.h"
44
34
typedef struct st_key KEY;
45
36
typedef struct st_key_cache KEY_CACHE;
40
/* true is not all entries in the ht[] support 2pc */
42
/* storage engines that registered in this transaction */
45
The purpose of this flag is to keep track of non-transactional
46
tables that were modified in scope of:
47
- transaction, when the variable is a member of
48
Session::transaction.all
49
- top-level statement or sub-statement, when the variable is a
50
member of Session::transaction.stmt
51
This member has the following life cycle:
52
* stmt.modified_non_trans_table is used to keep track of
53
modified non-transactional tables of top-level statements. At
54
the end of the previous statement and at the beginning of the session,
55
it is reset to false. If such functions
56
as mysql_insert, mysql_update, mysql_delete etc modify a
57
non-transactional table, they set this flag to true. At the
58
end of the statement, the value of stmt.modified_non_trans_table
59
is merged with all.modified_non_trans_table and gets reset.
60
* all.modified_non_trans_table is reset at the end of transaction
62
* Since we do not have a dedicated context for execution of a
63
sub-statement, to keep track of non-transactional changes in a
64
sub-statement, we re-use stmt.modified_non_trans_table.
65
At entrance into a sub-statement, a copy of the value of
66
stmt.modified_non_trans_table (containing the changes of the
67
outer statement) is saved on stack. Then
68
stmt.modified_non_trans_table is reset to false and the
69
substatement is executed. Then the new value is merged with the
72
bool modified_non_trans_table;
74
void reset() { no_2pc= false; modified_non_trans_table= false; }
78
uint64_t data_file_length;
79
uint64_t max_data_file_length;
80
uint64_t index_file_length;
81
uint64_t delete_length;
83
uint32_t mean_rec_length;
53
90
typedef struct st_ha_create_information
55
92
const CHARSET_INFO *table_charset, *default_table_charset;
93
LEX_STRING connect_string;
95
const char *data_file_name, *index_file_name;
97
uint64_t max_rows,min_rows;
57
98
uint64_t auto_increment_value;
58
99
uint32_t table_options;
100
uint32_t avg_row_length;
59
101
uint32_t used_fields;
102
uint32_t key_block_size;
60
105
enum row_type row_type;
61
plugin::StorageEngine *db_type;
106
uint32_t null_bits; /* NULL bits at start of record */
107
uint32_t options; /* OR of HA_CREATE_ options */
108
uint32_t extra_size; /* length of extra data segment */
62
109
bool table_existed; /* 1 in create if table existed */
110
bool varchar; /* 1 if table has a VARCHAR */
111
enum ha_choice page_checksum; /* If we have page_checksums */
65
114
typedef struct st_ha_alter_information