1 /***************************************************************************** 2 3 Copyright (c) 1996, 2009, Oracle and/or its affiliates. All Rights Reserved. 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 UNIV_INTERN 51 sess_t* 52 sess_open(void); 53 /*============*/ 54 /*********************************************************************//** 55 Closes a session, freeing the memory occupied by it. */ 56 UNIV_INTERN 57 void 58 sess_close( 59 /*=======*/ 60 sess_t* sess); /* in, own: session object */ 61 62 /* The session handle. This data structure is only used by purge and is 63 not really necessary. We should get rid of it. */ 64 struct sess_t{ 65 ulint state; /*!< state of the session */ 66 trx_t* trx; /*!< transaction object permanently 67 assigned for the session: the 68 transaction instance designated by the 69 trx id changes, but the memory 70 structure is preserved */ 71 UT_LIST_BASE_NODE_T(que_t) 72 graphs; /*!< query graphs belonging to this 73 session */ 74 }; 75 76 /* Session states */ 77 #define SESS_ACTIVE 1 78 #define SESS_ERROR 2 /* session contains an error message 79 which has not yet been communicated 80 to the client */ 81 #ifndef UNIV_NONINL 82 #include "usr0sess.ic" 83 #endif 84 85 #endif 86