My Project
ndb_thd.h
00001 /*
00002    Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
00003 
00004    This program is free software; you can redistribute it and/or modify
00005    it under the terms of the GNU General Public License as published by
00006    the Free Software Foundation; version 2 of the License.
00007 
00008    This program is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011    GNU General Public License for more details.
00012 
00013    You should have received a copy of the GNU General Public License
00014    along with this program; if not, write to the Free Software
00015    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
00016 */
00017 
00018 #ifndef NDB_THD_H
00019 #define NDB_THD_H
00020 
00021 #include <mysql/plugin.h>
00022 
00023 extern handlerton* ndbcluster_hton;
00024 
00025 /* Get Thd_ndb pointer from THD */
00026 static inline
00027 class Thd_ndb*
00028 thd_get_thd_ndb(THD* thd)
00029 {
00030   return (class Thd_ndb *) thd_get_ha_data(thd, ndbcluster_hton);
00031 }
00032   
00033 /* Backward compatibility alias for 'thd_get_thd_ndb'  */
00034 static inline
00035 class Thd_ndb*
00036 get_thd_ndb(THD* thd)
00037 {
00038   return thd_get_thd_ndb(thd);
00039 }
00040 
00041 
00042 /* Set Thd_ndb pointer for THD */
00043 static inline
00044 void
00045 thd_set_thd_ndb(THD *thd, class Thd_ndb *thd_ndb)
00046 {
00047   thd_set_ha_data(thd, ndbcluster_hton, thd_ndb);
00048 }
00049 
00050 
00051 /* Make sure THD has a Thd_ndb struct assigned */
00052 class Ndb* check_ndb_in_thd(THD* thd, bool validate_ndb= false);
00053 
00054 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines