1 /***************************************************************************** 2 3 Copyright (c) 1996, 2021, Oracle and/or its affiliates. 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License, version 2.0, 7 as published by the Free Software Foundation. 8 9 This program is also distributed with certain software (including 10 but not limited to OpenSSL) that is licensed under separate terms, 11 as designated in a particular file or component or in included license 12 documentation. The authors of MySQL hereby grant you an additional 13 permission to link the program and your derivative works with the 14 separately licensed software that they have included with MySQL. 15 16 This program is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 GNU General Public License, version 2.0, for more details. 20 21 You should have received a copy of the GNU General Public License along with 22 this program; if not, write to the Free Software Foundation, Inc., 23 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA 24 25 *****************************************************************************/ 26 27 /**************************************************//** 28 @file include/usr0sess.h 29 Sessions 30 31 Created 6/25/1996 Heikki Tuuri 32 *******************************************************/ 33 34 #ifndef usr0sess_h 35 #define usr0sess_h 36 37 #include "univ.i" 38 #include "ut0byte.h" 39 #include "trx0types.h" 40 #include "srv0srv.h" 41 #include "trx0types.h" 42 #include "usr0types.h" 43 #include "que0types.h" 44 #include "data0data.h" 45 #include "rem0rec.h" 46 47 /*********************************************************************//** 48 Opens a session. 49 @return own: session object */ 50 sess_t* 51 sess_open(void); 52 /*============*/ 53 /*********************************************************************//** 54 Closes a session, freeing the memory occupied by it. */ 55 void 56 sess_close( 57 /*=======*/ 58 sess_t* sess); /* in, own: session object */ 59 60 /* The session handle. This data structure is only used by purge and is 61 not really necessary. We should get rid of it. */ 62 struct sess_t{ 63 ulint state; /*!< state of the session */ 64 trx_t* trx; /*!< transaction object permanently 65 assigned for the session: the 66 transaction instance designated by the 67 trx id changes, but the memory 68 structure is preserved */ 69 }; 70 71 /* Session states */ 72 #define SESS_ACTIVE 1 73 #define SESS_ERROR 2 /* session contains an error message 74 which has not yet been communicated 75 to the client */ 76 #ifndef UNIV_NONINL 77 #include "usr0sess.ic" 78 #endif 79 80 #endif 81