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
#include <drizzled/server_includes.h>
21
#include <drizzled/ha_trx_info.h>
22
#include <drizzled/handlerton.h>
23
#include <drizzled/session.h>
26
void Ha_trx_info::register_ha(Session_TRANS *trans, handlerton *ht_arg)
30
assert(m_next == NULL);
33
m_flags= (int) TRX_READ_ONLY; /* Assume read-only at start. */
35
m_next= trans->ha_list;
40
/** Clear, prepare for reuse. */
41
void Ha_trx_info::reset()
48
void Ha_trx_info::set_trx_read_write()
51
m_flags|= (int) TRX_READ_WRITE;
55
bool Ha_trx_info::is_trx_read_write() const
58
return m_flags & (int) TRX_READ_WRITE;
62
bool Ha_trx_info::is_started() const
68
/** Mark this transaction read-write if the argument is read-write. */
69
void Ha_trx_info::coalesce_trx_with(const Ha_trx_info *stmt_trx)
72
Must be called only after the transaction has been started.
73
Can be called many times, e.g. when we have many
74
read-write statements in a transaction.
77
if (stmt_trx->is_trx_read_write())
82
Ha_trx_info *Ha_trx_info::next() const
89
handlerton *Ha_trx_info::ht() const