MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndb_mi.cc
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 #include "ndb_mi.h"
19 #include "ha_ndbcluster_glue.h"
20 #include "my_sys.h"
21 #include "hash.h"
22 #include "rpl_mi.h"
23 
24 #ifdef HAVE_NDB_BINLOG
25 
26 extern Master_info *active_mi;
27 
28 
29 uint32 ndb_mi_get_master_server_id()
30 {
31  return (uint32) active_mi->master_id;
32 }
33 
34 const char* ndb_mi_get_group_master_log_name()
35 {
36 #if MYSQL_VERSION_ID < 50600
37  return active_mi->rli.group_master_log_name;
38 #else
39  return active_mi->rli->get_group_master_log_name();
40 #endif
41 }
42 
43 uint64 ndb_mi_get_group_master_log_pos()
44 {
45 #if MYSQL_VERSION_ID < 50600
46  return (uint64) active_mi->rli.group_master_log_pos;
47 #else
48  return (uint64) active_mi->rli->get_group_master_log_pos();
49 #endif
50 }
51 
52 uint64 ndb_mi_get_future_event_relay_log_pos()
53 {
54 #if MYSQL_VERSION_ID < 50600
55  return (uint64) active_mi->rli.future_event_relay_log_pos;
56 #else
57  return (uint64) active_mi->rli->get_future_event_relay_log_pos();
58 #endif
59 }
60 
61 uint64 ndb_mi_get_group_relay_log_pos()
62 {
63 #if MYSQL_VERSION_ID < 50600
64  return (uint64) active_mi->rli.group_relay_log_pos;
65 #else
66  return (uint64) active_mi->rli->get_group_relay_log_pos();
67 #endif
68 }
69 
70 bool ndb_mi_get_ignore_server_id(uint32 server_id)
71 {
72  return (active_mi->shall_ignore_server_id(server_id) != 0);
73 }
74 
75 uint32 ndb_mi_get_slave_run_id()
76 {
77  return active_mi->rli->slave_run_id;
78 }
79 
80 bool ndb_mi_get_in_relay_log_statement(Relay_log_info* rli)
81 {
82  return (rli->get_flag(Relay_log_info::IN_STMT) != 0);
83 }
84 
85 /* #ifdef HAVE_NDB_BINLOG */
86 
87 #endif