20
20
#include "config.h"
21
#include <drizzled/ha_trx_info.h>
22
#include <drizzled/plugin/storage_engine.h>
23
#include <drizzled/session.h>
21
#include "drizzled/resource_context.h"
28
void Ha_trx_info::register_ha(Session_TRANS *trans,
29
plugin::StorageEngine *engine_arg)
32
assert(m_engine == NULL);
33
assert(m_next == NULL);
36
m_flags= (int) TRX_READ_ONLY; /* Assume read-only at start. */
38
m_next= trans->ha_list;
43
30
/** Clear, prepare for reuse. */
44
void Ha_trx_info::reset()
51
void Ha_trx_info::set_trx_read_write()
54
m_flags|= (int) TRX_READ_WRITE;
58
bool Ha_trx_info::is_trx_read_write() const
61
return m_flags & (int) TRX_READ_WRITE;
65
bool Ha_trx_info::is_started() const
67
return m_engine != NULL;
71
/** Mark this transaction read-write if the argument is read-write. */
72
void Ha_trx_info::coalesce_trx_with(const Ha_trx_info *stmt_trx)
31
void ResourceContext::reset()
34
xa_resource_manager= NULL;
35
trx_storage_engine= NULL;
39
void ResourceContext::markModifiedData()
45
bool ResourceContext::hasModifiedData() const
51
bool ResourceContext::isStarted() const
53
return monitored != NULL;
56
void ResourceContext::coalesceWith(const ResourceContext *stmt_ctx)
75
59
Must be called only after the transaction has been started.
76
60
Can be called many times, e.g. when we have many
77
61
read-write statements in a transaction.
80
if (stmt_trx->is_trx_read_write())
85
Ha_trx_info *Ha_trx_info::next() const
92
plugin::StorageEngine *Ha_trx_info::engine() const
64
if (stmt_ctx->hasModifiedData())
98
68
} /* namespace drizzled */