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;
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; }
53
79
typedef struct st_ha_create_information