~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/innobase/include/usr0sess.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 
 
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
 
4
 
 
5
This program is free software; you can redistribute it and/or modify it under
 
6
the terms of the GNU General Public License as published by the Free Software
 
7
Foundation; version 2 of the License.
 
8
 
 
9
This program is distributed in the hope that it will be useful, but WITHOUT
 
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
12
 
 
13
You should have received a copy of the GNU General Public License along with
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
 
16
 
 
17
*****************************************************************************/
 
18
 
 
19
/**************************************************//**
 
20
@file include/usr0sess.h
 
21
Sessions
 
22
 
 
23
Created 6/25/1996 Heikki Tuuri
 
24
*******************************************************/
 
25
 
 
26
#ifndef usr0sess_h
 
27
#define usr0sess_h
 
28
 
 
29
#include "univ.i"
 
30
#include "ut0byte.h"
 
31
#include "trx0types.h"
 
32
#include "srv0srv.h"
 
33
#include "trx0types.h"
 
34
#include "usr0types.h"
 
35
#include "que0types.h"
 
36
#include "data0data.h"
 
37
#include "rem0rec.h"
 
38
 
 
39
/*********************************************************************//**
 
40
Opens a session.
 
41
@return own: session object */
 
42
UNIV_INTERN
 
43
sess_t*
 
44
sess_open(void);
 
45
/*============*/
 
46
/*********************************************************************//**
 
47
Closes a session, freeing the memory occupied by it, if it is in a state
 
48
where it should be closed.
 
49
@return TRUE if closed */
 
50
UNIV_INTERN
 
51
ibool
 
52
sess_try_close(
 
53
/*===========*/
 
54
        sess_t*         sess);  /*!< in, own: session object */
 
55
 
 
56
/* The session handle. All fields are protected by the kernel mutex */
 
57
struct sess_struct{
 
58
        ulint           state;          /*!< state of the session */
 
59
        trx_t*          trx;            /*!< transaction object permanently
 
60
                                        assigned for the session: the
 
61
                                        transaction instance designated by the
 
62
                                        trx id changes, but the memory
 
63
                                        structure is preserved */
 
64
        UT_LIST_BASE_NODE_T(que_t)
 
65
                        graphs;         /*!< query graphs belonging to this
 
66
                                        session */
 
67
};
 
68
 
 
69
/* Session states */
 
70
#define SESS_ACTIVE             1
 
71
#define SESS_ERROR              2       /* session contains an error message
 
72
                                        which has not yet been communicated
 
73
                                        to the client */
 
74
#ifndef UNIV_NONINL
 
75
#include "usr0sess.ic"
 
76
#endif
 
77
 
 
78
#endif