00001 /****************************************************** 00002 Sessions 00003 00004 (c) 1996 Innobase Oy 00005 00006 Created 6/25/1996 Heikki Tuuri 00007 *******************************************************/ 00008 00009 #ifndef usr0sess_h 00010 #define usr0sess_h 00011 00012 #include "univ.i" 00013 #include "ut0byte.h" 00014 #include "trx0types.h" 00015 #include "srv0srv.h" 00016 #include "trx0types.h" 00017 #include "usr0types.h" 00018 #include "que0types.h" 00019 #include "data0data.h" 00020 #include "rem0rec.h" 00021 00022 /************************************************************************* 00023 Opens a session. */ 00024 00025 sess_t* 00026 sess_open(void); 00027 /*============*/ 00028 /* out, own: session object */ 00029 /************************************************************************* 00030 Closes a session, freeing the memory occupied by it, if it is in a state 00031 where it should be closed. */ 00032 00033 ibool 00034 sess_try_close( 00035 /*===========*/ 00036 /* out: TRUE if closed */ 00037 sess_t* sess); /* in, own: session object */ 00038 00039 /* The session handle. All fields are protected by the kernel mutex */ 00040 struct sess_struct{ 00041 ulint state; /* state of the session */ 00042 trx_t* trx; /* transaction object permanently 00043 assigned for the session: the 00044 transaction instance designated by the 00045 trx id changes, but the memory 00046 structure is preserved */ 00047 UT_LIST_BASE_NODE_T(que_t) 00048 graphs; /* query graphs belonging to this 00049 session */ 00050 }; 00051 00052 /* Session states */ 00053 #define SESS_ACTIVE 1 00054 #define SESS_ERROR 2 /* session contains an error message 00055 which has not yet been communicated 00056 to the client */ 00057 #ifndef UNIV_NONINL 00058 #include "usr0sess.ic" 00059 #endif 00060 00061 #endif
1.4.7

