21
21
#ifndef DRIZZLED_SESSION_H
22
22
#define DRIZZLED_SESSION_H
24
/* Classes in mysql */
26
24
#include "drizzled/plugin.h"
27
#include <drizzled/sql_locale.h>
25
#include "drizzled/sql_locale.h"
28
26
#include "drizzled/resource_context.h"
29
#include <drizzled/cursor.h>
30
#include <drizzled/current_session.h>
31
#include <drizzled/sql_error.h>
32
#include <drizzled/file_exchange.h>
33
#include <drizzled/select_result_interceptor.h>
34
#include <drizzled/statistics_variables.h>
35
#include <drizzled/xid.h>
27
#include "drizzled/cursor.h"
28
#include "drizzled/current_session.h"
29
#include "drizzled/sql_error.h"
30
#include "drizzled/file_exchange.h"
31
#include "drizzled/select_result_interceptor.h"
32
#include "drizzled/statistics_variables.h"
33
#include "drizzled/xid.h"
36
34
#include "drizzled/query_id.h"
37
35
#include "drizzled/named_savepoint.h"
38
36
#include "drizzled/transaction_context.h"
39
37
#include "drizzled/util/storable.h"
41
38
#include "drizzled/my_hash.h"
49
46
#include "drizzled/internal/getrusage.h"
51
#include <drizzled/security_context.h>
52
#include <drizzled/open_tables_state.h>
54
#include <drizzled/internal_error_handler.h>
55
#include <drizzled/diagnostics_area.h>
57
#include <drizzled/plugin/authorization.h>
47
#include "drizzled/security_context.h"
48
#include "drizzled/open_tables_state.h"
49
#include "drizzled/internal_error_handler.h"
50
#include "drizzled/diagnostics_area.h"
51
#include "drizzled/plugin/authorization.h"
59
53
#include <boost/unordered_map.hpp>
60
54
#include <boost/thread/mutex.hpp>
550
544
ResourceContext *getResourceContext(const plugin::MonitoredInTransaction *monitored,
551
545
size_t index= 0);
548
* Structure used to manage "statement transactions" and
549
* "normal transactions". In autocommit mode, the normal transaction is
550
* equivalent to the statement transaction.
552
* Storage engines will be registered here when they participate in
553
* a transaction. No engine is registered more than once.
553
555
struct st_transactions {
554
556
std::deque<NamedSavepoint> savepoints;
555
TransactionContext all; ///< Trans since BEGIN WORK
556
TransactionContext stmt; ///< Trans for current statement
559
* The normal transaction (since BEGIN WORK).
561
* Contains a list of all engines that have participated in any of the
562
* statement transactions started within the context of the normal
565
* @note In autocommit mode, this is empty.
567
TransactionContext all;
570
* The statment transaction.
572
* Contains a list of all engines participating in the given statement.
574
* @note In autocommit mode, this will be used to commit/rollback the
575
* normal transaction.
577
TransactionContext stmt;
557
579
XID_STATE xid_state;
1197
1219
* Current implementation does not depend on that, but future changes
1198
1220
* should be done with this in mind;
1200
* @param Scrambled password received from client
1201
* @param Length of scrambled password
1202
* @param Database name to connect to, may be NULL
1222
* @param passwd Scrambled password received from client
1223
* @param db Database name to connect to, may be NULL
1204
1225
bool checkUser(const std::string &passwd, const std::string &db);