MySQL 8.0.31
Source Code Documentation
usr0sess.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1996, 2022, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is also distributed with certain software (including but not
10limited to OpenSSL) that is licensed under separate terms, as designated in a
11particular file or component or in included license documentation. The authors
12of MySQL hereby grant you an additional permission to link the program and
13your derivative works with the separately licensed software that they have
14included with MySQL.
15
16This program is distributed in the hope that it will be useful, but WITHOUT
17ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
19for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc.,
2351 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
25*****************************************************************************/
26
27/** @file include/usr0sess.h
28 Sessions
29
30 Created 6/25/1996 Heikki Tuuri
31 *******************************************************/
32
33#ifndef usr0sess_h
34#define usr0sess_h
35
36#include "data0data.h"
37#include "que0types.h"
38#include "rem0rec.h"
39#include "srv0srv.h"
40#include "trx0types.h"
41#include "univ.i"
42#include "usr0types.h"
43#include "ut0byte.h"
44
45/** Opens a session.
46 @return own: session object */
47sess_t *sess_open(void);
48/** Closes a session, freeing the memory occupied by it. */
49void sess_close(sess_t *sess); /* in, own: session object */
50
51/* The session handle. This data structure is only used by purge and is
52not really necessary. We should get rid of it. */
53struct sess_t {
54 ulint state; /*!< state of the session */
55 trx_t *trx; /*!< transaction object permanently
56 assigned for the session: the
57 transaction instance designated by the
58 trx id changes, but the memory
59 structure is preserved */
60};
61
62/* Session states */
63constexpr uint32_t SESS_ACTIVE = 1;
64/** session contains an error message which has not yet been communicated to the
65client */
66constexpr uint32_t SESS_ERROR = 2;
67
68#endif
SQL data field and tuple.
Query graph global types.
Record manager.
The server main program.
Definition: usr0sess.h:53
ulint state
state of the session
Definition: usr0sess.h:54
trx_t * trx
transaction object permanently assigned for the session: the transaction instance designated by the t...
Definition: usr0sess.h:55
Definition: trx0trx.h:680
Transaction system global type definitions.
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:407
constexpr uint32_t SESS_ERROR
session contains an error message which has not yet been communicated to the client
Definition: usr0sess.h:66
sess_t * sess_open(void)
Opens a session.
Definition: usr0sess.cc:38
void sess_close(sess_t *sess)
Closes a session, freeing the memory occupied by it.
Definition: usr0sess.cc:53
constexpr uint32_t SESS_ACTIVE
Definition: usr0sess.h:63
Users and sessions global types.
Utilities for byte operations.