54
54
resource_contexts.push_back(resource);
58
* Marks that this transaction has modified state
59
* of some non-transactional data.
61
void markModifiedNonTransData()
63
modified_non_trans_data= true;
67
* Returns true if the transaction has modified
68
* state of some non-transactional data.
70
bool hasModifiedNonTransData() const
72
return modified_non_trans_data;
57
75
/* true is not all entries in the resource contexts support 2pc */
60
/* storage engines that registered in this transaction */
78
/** Resource that registered in this transaction */
61
79
ResourceContexts resource_contexts;
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;
80
/** Whether this transaction has changed non-transaction data state */
81
bool modified_non_trans_data;
94
84
} /* namespace drizzled */