MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndb_thd.h
1 /*
2  Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef NDB_THD_H
19 #define NDB_THD_H
20 
21 #include <mysql/plugin.h>
22 
23 extern handlerton* ndbcluster_hton;
24 
25 /* Get Thd_ndb pointer from THD */
26 static inline
27 class Thd_ndb*
28 thd_get_thd_ndb(THD* thd)
29 {
30  return (class Thd_ndb *) thd_get_ha_data(thd, ndbcluster_hton);
31 }
32 
33 /* Backward compatibility alias for 'thd_get_thd_ndb' */
34 static inline
35 class Thd_ndb*
36 get_thd_ndb(THD* thd)
37 {
38  return thd_get_thd_ndb(thd);
39 }
40 
41 
42 /* Set Thd_ndb pointer for THD */
43 static inline
44 void
45 thd_set_thd_ndb(THD *thd, class Thd_ndb *thd_ndb)
46 {
47  thd_set_ha_data(thd, ndbcluster_hton, thd_ndb);
48 }
49 
50 
51 /* Make sure THD has a Thd_ndb struct assigned */
52 class Ndb* check_ndb_in_thd(THD* thd, bool validate_ndb= false);
53 
54 #endif