1/*
2   Copyright (c) 2004, 2010, 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, version 2.0,
6   as published by the Free Software Foundation.
7
8   This program is also distributed with certain software (including
9   but not limited to OpenSSL) that is licensed under separate terms,
10   as designated in a particular file or component or in included license
11   documentation.  The authors of MySQL hereby grant you an additional
12   permission to link the program and your derivative works with the
13   separately licensed software that they have included with MySQL.
14
15   This program is distributed in the hope that it will be useful,
16   but WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18   GNU General Public License, version 2.0, for more details.
19
20   You should have received a copy of the GNU General Public License
21   along with this program; if not, write to the Free Software
22   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
23*/
24
25#ifndef NDB_VERSION_H
26#define NDB_VERSION_H
27
28#include <ndb_types.h>
29#include <mysql_version.h>
30
31/*
32  Creates a composite version number from major, minor and build
33  ex: NDB_MAKE_VERSION(5,1,47) => 0x00050147
34*/
35#define NDB_MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8)  | ((C) << 0))
36
37/* NDB version numbers and status  */
38#define NDB_VERSION_MAJOR @NDB_VERSION_MAJOR@
39#define NDB_VERSION_MINOR @NDB_VERSION_MINOR@
40#define NDB_VERSION_BUILD @NDB_VERSION_BUILD@
41#define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@"
42
43/* Composite version number for NDB */
44#define NDB_VERSION_D \
45  NDB_MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD)
46
47/*
48  The version number of the MySQL Server that NDB is built
49  with. Extracted from MYSQL_VERSION_ID
50*/
51#define NDB_MYSQL_VERSION_MAJOR ((MYSQL_VERSION_ID / 10000) % 100)
52#define NDB_MYSQL_VERSION_MINOR ((MYSQL_VERSION_ID /100) % 100)
53#define NDB_MYSQL_VERSION_BUILD (MYSQL_VERSION_ID % 100)
54
55/* Composite version number for MYSQL Server */
56#define NDB_MYSQL_VERSION_D \
57  NDB_MAKE_VERSION(NDB_MYSQL_VERSION_MAJOR, \
58                   NDB_MYSQL_VERSION_MINOR, \
59                   NDB_MYSQL_VERSION_BUILD)
60
61#define NDB_VERSION_STRING_BUF_SZ 100
62
63#ifdef __cplusplus
64extern "C" {
65#endif
66
67void ndbPrintVersion();
68
69Uint32 ndbMakeVersion(Uint32 major, Uint32 minor, Uint32 build);
70
71Uint32 ndbGetMajor(Uint32 version);
72
73Uint32 ndbGetMinor(Uint32 version);
74
75Uint32 ndbGetBuild(Uint32 version);
76
77const char* ndbGetVersionString(Uint32 version, Uint32 mysql_version, const char * status,
78                                char *buf, unsigned sz);
79const char* ndbGetOwnVersionString();
80
81Uint32 ndbGetOwnVersion();
82
83#ifdef __cplusplus
84}
85#endif
86
87#define NDB_VERSION_STRING ndbGetOwnVersionString()
88
89#define NDB_VERSION ndbGetOwnVersion()
90
91/**
92 * This is updated each time a version of backup/lcp format is changed
93 *   when it's updated, it's set to version that made the change
94 */
95#define NDB_BACKUP_VERSION NDB_MAKE_VERSION(6,3,11)
96
97/**
98 * From which version do we support rowid
99 */
100#define NDBD_ROWID_VERSION (NDB_MAKE_VERSION(5,1,6))
101#define NDBD_INCL_NODECONF_VERSION_4 NDB_MAKE_VERSION(4,1,17)
102#define NDBD_INCL_NODECONF_VERSION_5 NDB_MAKE_VERSION(5,0,18)
103#define NDBD_FRAGID_VERSION (NDB_MAKE_VERSION(5,1,6))
104#define NDBD_DICT_LOCK_VERSION_5 NDB_MAKE_VERSION(5,0,23)
105#define NDBD_DICT_LOCK_VERSION_5_1 NDB_MAKE_VERSION(5,1,12)
106
107#define NDBD_UPDATE_FRAG_DIST_KEY_50 NDB_MAKE_VERSION(5,0,26)
108#define NDBD_UPDATE_FRAG_DIST_KEY_51 NDB_MAKE_VERSION(5,1,12)
109
110#define NDBD_QMGR_SINGLEUSER_VERSION_5 NDB_MAKE_VERSION(5,0,25)
111
112#define NDBD_SPLIT_VERSION NDB_MAKE_VERSION(6,1,0)
113#define NDBD_NODE_VERSION_REP NDB_MAKE_VERSION(6,1,1)
114
115#define NDBD_255_NODES_VERSION NDB_MAKE_VERSION(5,1,4)
116
117#define NDBD_MICRO_GCP_62 NDB_MAKE_VERSION(6,2,5)
118#define NDBD_MICRO_GCP_63 NDB_MAKE_VERSION(6,3,2)
119#define NDBD_RAW_LCP MAKE_VERSION(6,3,11)
120#define NDBD_LONG_TCKEYREQ NDB_MAKE_VERSION(6,4,0)
121#define NDBD_LONG_LQHKEYREQ MAKE_VERSION(6,4,0)
122#define NDBD_MAX_RECVBYTESIZE_32K MAKE_VERSION(6,3,18)
123#define NDBD_LONG_SCANTABREQ NDB_MAKE_VERSION(6,4,0)
124#define NDBD_LONG_SCANFRAGREQ MAKE_VERSION(6,4,0)
125#define NDBD_MT_LQH_VERSION MAKE_VERSION(6,4,0)
126
127#define NDBD_SCHEMA_TRANS_VERSION NDB_MAKE_VERSION(6,4,0)
128
129static
130inline
131int
132ndb_check_micro_gcp(Uint32 version)
133{
134  if (version == NDB_VERSION_D)
135    return 1;
136  {
137    const Uint32 major = (version >> 16) & 0xFF;
138    const Uint32 minor = (version >>  8) & 0xFF;
139    if (major >= 6)
140    {
141      if (minor == 2)
142        return version >= NDBD_MICRO_GCP_62;
143      return version >= NDBD_MICRO_GCP_63;
144    }
145  }
146  return 0;
147}
148
149#define NDBD_PREPARE_COPY_FRAG_VERSION NDB_MAKE_VERSION(6,2,1)
150#define NDBD_PREPARE_COPY_FRAG_V2_51 NDB_MAKE_VERSION(5,1,23)
151#define NDBD_PREPARE_COPY_FRAG_V2_62 NDB_MAKE_VERSION(6,2,8)
152#define NDBD_PREPARE_COPY_FRAG_V2_63 NDB_MAKE_VERSION(6,3,6)
153
154/**
155 * 0 = NO PREP COPY FRAG SUPPORT
156 * 1 = NO MAX PAGE SUPPORT
157 * 2 = LATEST VERSION
158 */
159static
160inline
161int
162ndb_check_prep_copy_frag_version(Uint32 version)
163{
164  const Uint32 major = (version >> 16) & 0xFF;
165  const Uint32 minor = (version >>  8) & 0xFF;
166
167  if (version == NDB_VERSION_D)
168    return 2;
169
170  if (major >= 6)
171  {
172    if (minor == 2)
173    {
174      if (version >= NDBD_PREPARE_COPY_FRAG_V2_62)
175        return 2;
176      if (version >= NDBD_PREPARE_COPY_FRAG_VERSION)
177        return 1;
178      return 0;
179    }
180    else if (minor == 3)
181    {
182      if (version >= NDBD_PREPARE_COPY_FRAG_V2_63)
183        return 2;
184      return 1;
185    }
186    return 2;
187  }
188  else if (major == 5 && minor == 1)
189  {
190    if (version >= NDBD_PREPARE_COPY_FRAG_V2_51)
191      return 2;
192  }
193
194  return 0;
195}
196
197#define NDBD_PNR NDB_MAKE_VERSION(6,3,8)
198
199static
200inline
201int
202ndb_pnr(Uint32 version)
203{
204  return
205    version == NDB_VERSION_D || version >= NDBD_PNR;
206}
207
208#define NDBD_SUMA_DICT_LOCK_62 NDB_MAKE_VERSION(6,2,14)
209#define NDBD_SUMA_DICT_LOCK_63 NDB_MAKE_VERSION(6,3,11)
210
211static
212inline
213int
214ndbd_suma_dictlock_startme(Uint32 x)
215{
216  if (x >= NDB_VERSION_D)
217    return 1;
218
219  {
220    const Uint32 major = (x >> 16) & 0xFF;
221    const Uint32 minor = (x >>  8) & 0xFF;
222
223    if (major >= 6)
224    {
225      if (minor == 2)
226      return x >= NDBD_SUMA_DICT_LOCK_62;
227    }
228
229    return x >= NDBD_SUMA_DICT_LOCK_63;
230  }
231}
232
233#define NDBD_LONG_LIST_TABLES_CONF_62 NDB_MAKE_VERSION(6,2,16)
234#define NDBD_LONG_LIST_TABLES_CONF_63 NDB_MAKE_VERSION(6,3,15)
235
236static
237inline
238int
239ndbd_LIST_TABLES_CONF_long_signal(Uint32 x)
240{
241  if (x >= NDB_VERSION_D)
242    return 1;
243
244  {
245    const Uint32 major = (x >> 16) & 0xFF;
246    const Uint32 minor = (x >>  8) & 0xFF;
247
248    if (major >= 6)
249    {
250      if (minor == 2)
251        return x >= NDBD_LONG_LIST_TABLES_CONF_62;
252    }
253
254    return x >= NDBD_LONG_LIST_TABLES_CONF_63;
255  }
256}
257
258#if NOT_YET
259#define NDBD_FIRE_TRIG_ORD_TRANSID_63 NDB_MAKE_VERSION(6,3,9)
260#define NDBD_FIRE_TRIG_ORD_TRANSID_62 NDB_MAKE_VERSION(6,2,12)
261#endif
262
263static
264inline
265int
266ndb_fire_trig_ord_transid(Uint32 version)
267{
268  if (version >= NDB_VERSION_D)
269    return 1;
270
271#if NOT_YET
272  const Uint32 major = (version >> 16) & 0xFF;
273  const Uint32 minor = (version >>  8) & 0xFF;
274  if (major >= 6)
275  {
276    if (minor == 2)
277    {
278      return version >= NDBD_FIRE_TRIG_ORD_TRANSID_62;
279    }
280
281    return version >= NDBD_FIRE_TRIG_ORD_TRANSID_63;
282  }
283#endif
284
285  return 0;
286}
287
288#define NDBD_SCAN_DISTKEY NDB_MAKE_VERSION(6,4,0)
289
290static
291inline
292int
293ndb_scan_distributionkey(Uint32 version)
294{
295  return version >= NDBD_SCAN_DISTKEY;
296}
297
298#define NDBD_FILTER_INSTANCE_63 NDB_MAKE_VERSION(6,3,16)
299#define NDBD_COPY_GCI_RESTART_NR NDB_MAKE_VERSION(6,3,18)
300
301#define NDBD_SUMA_DICTLOCK_HANDOVER NDB_MAKE_VERSION(6,4,0)
302
303static
304inline
305int
306ndbd_suma_dictlock_handover(Uint32 x)
307{
308  return (x >= NDBD_SUMA_DICTLOCK_HANDOVER);
309}
310
311#define NDBD_API_TAKE_OVERTCCONF_60 NDB_MAKE_VERSION(5,2,4)
312#define NDBD_API_TAKE_OVERTCCONF_62 NDB_MAKE_VERSION(6,2,17)
313#define NDBD_API_TAKE_OVERTCCONF_63 NDB_MAKE_VERSION(6,3,19)
314
315#define NDBD_DELAYED_COPY_ACTIVEREQ_63 NDB_MAKE_VERSION(6,3,29)
316#define NDBD_DELAYED_COPY_ACTIVEREQ_70 NDB_MAKE_VERSION(7,0,10)
317
318static
319inline
320int
321ndb_takeovertc(Uint32 x)
322{
323  if (x >= NDB_VERSION_D)
324    return 1;
325
326  {
327    const Uint32 major = (x >> 16) & 0xFF;
328    const Uint32 minor = (x >>  8) & 0xFF;
329
330    if (major >= 6)
331    {
332      if (minor == 2)
333        return x >= NDBD_API_TAKE_OVERTCCONF_62;
334    }
335
336    return x >= NDBD_API_TAKE_OVERTCCONF_63;
337  }
338}
339
340static
341inline
342int
343ndb_delayed_copy_active_req(Uint32 x)
344{
345  if (x >= NDB_VERSION_D)
346    return 1;
347
348  {
349    const Uint32 major = (x >> 16) & 0xFF;
350
351    if (major == 6)
352    {
353      return x >= NDBD_DELAYED_COPY_ACTIVEREQ_63;
354    }
355    else
356    {
357      return x >= NDBD_DELAYED_COPY_ACTIVEREQ_70;
358    }
359  }
360}
361
362#define NDBD_SUMA_NOTSTARTED_REF_63 NDB_MAKE_VERSION(6,3,29)
363#define NDBD_SUMA_NOTSTARTED_REF_70 NDB_MAKE_VERSION(7,0,10)
364
365static
366inline
367int
368ndb_suma_not_started_ref(Uint32 x)
369{
370  if (x >= NDB_VERSION_D)
371    return 1;
372
373  {
374    const Uint32 major = (x >> 16) & 0xFF;
375
376    if (major == 6)
377    {
378      return x >= NDBD_SUMA_NOTSTARTED_REF_63;
379    }
380    else
381    {
382      return x >= NDBD_SUMA_NOTSTARTED_REF_70;
383    }
384  }
385}
386
387#define NDBD_UNLOCK_OP_SUPPORTED NDB_MAKE_VERSION(7,0,12)
388
389#define NDBD_ROUTE_EXEC_FRAG NDB_MAKE_VERSION(7,0,13)
390
391static
392inline
393int
394ndb_route_exec_frag(Uint32 x)
395{
396  if (x >= NDB_VERSION_D)
397    return 1;
398
399  return x >= NDBD_ROUTE_EXEC_FRAG;
400}
401
402#define NDBD_NATIVE_DEFAULT_SUPPORT_70 NDB_MAKE_VERSION(7,0,15)
403#define NDBD_NATIVE_DEFAULT_SUPPORT_71 NDB_MAKE_VERSION(7,1,4)
404
405static
406inline
407int
408ndb_native_default_support(Uint32 x)
409{
410  const Uint32 major = (x >> 16) & 0xFF;
411  const Uint32 minor = (x >>  8) & 0xFF;
412
413  if (major == 7 && minor == 0)
414    return x >= NDBD_NATIVE_DEFAULT_SUPPORT_70;
415
416  return x >= NDBD_NATIVE_DEFAULT_SUPPORT_71;
417}
418
419#define NDBD_HB_ORDER_VERSION_63 NDB_MAKE_VERSION(6,3,35)
420#define NDBD_HB_ORDER_VERSION_70 NDB_MAKE_VERSION(7,0,16)
421#define NDBD_HB_ORDER_VERSION_71 NDB_MAKE_VERSION(7,1,5)
422
423static
424inline
425int
426ndb_check_hb_order_version(Uint32 x)
427{
428  {
429    const Uint32 major = (x >> 16) & 0xFF;
430    const Uint32 minor = (x >>  8) & 0xFF;
431
432    if (major == 6 && minor == 3)
433    {
434      return x >= NDBD_HB_ORDER_VERSION_63;
435    }
436    if (major == 7 && minor == 0)
437    {
438      return x >= NDBD_HB_ORDER_VERSION_70;
439    }
440    return x >= NDBD_HB_ORDER_VERSION_71;
441  }
442}
443
444#define NDBD_SYNCH_SP_70 NDB_MAKE_VERSION(7,0,17)
445#define NDBD_SYNCH_SP_71 NDB_MAKE_VERSION(7,1,6)
446
447static
448inline
449int
450ndb_wait_sp(Uint32 x)
451{
452  {
453    const Uint32 major = (x >> 16) & 0xFF;
454    const Uint32 minor = (x >>  8) & 0xFF;
455
456    if (major == 7 && minor == 0)
457    {
458      return x >= NDBD_SYNCH_SP_70;
459    }
460    return x >= NDBD_SYNCH_SP_71;
461  }
462}
463
464#define NDBD_DIH_GET_TABINFO_70 NDB_MAKE_VERSION(7,0,17)
465#define NDBD_DIH_GET_TABINFO_71 NDB_MAKE_VERSION(7,1,6)
466
467static
468inline
469int
470ndb_dih_get_tabinfo(Uint32 x)
471{
472  {
473    const Uint32 major = (x >> 16) & 0xFF;
474    const Uint32 minor = (x >>  8) & 0xFF;
475
476    if (major == 7 && minor == 0)
477    {
478      return x >= NDBD_DIH_GET_TABINFO_70;
479    }
480    return x >= NDBD_DIH_GET_TABINFO_71;
481  }
482}
483
484#define NDBD_SUMA_STOP_ME_63 NDB_MAKE_VERSION(6,3,37)
485#define NDBD_SUMA_STOP_ME_70 NDB_MAKE_VERSION(7,0,18)
486#define NDBD_SUMA_STOP_ME_71 NDB_MAKE_VERSION(7,1,7)
487
488static
489inline
490int
491ndbd_suma_stop_me(Uint32 x)
492{
493  {
494    const Uint32 major = (x >> 16) & 0xFF;
495    const Uint32 minor = (x >>  8) & 0xFF;
496
497    if (major == 6)
498    {
499      return x >= NDBD_SUMA_STOP_ME_63;
500    }
501    if (major == 7 && minor == 0)
502    {
503      return x >= NDBD_SUMA_STOP_ME_70;
504    }
505    return x >= NDBD_SUMA_STOP_ME_71;
506  }
507}
508
509#define NDBD_DIH_SUB_GCP_COMPLETE_ACK_63 NDB_MAKE_VERSION(6,3,39)
510#define NDBD_DIH_SUB_GCP_COMPLETE_ACK_70 NDB_MAKE_VERSION(7,0,20)
511#define NDBD_DIH_SUB_GCP_COMPLETE_ACK_71 NDB_MAKE_VERSION(7,1,9)
512
513static
514inline
515int
516ndbd_dih_sub_gcp_complete_ack(Uint32 x)
517{
518  {
519    const Uint32 major = (x >> 16) & 0xFF;
520    const Uint32 minor = (x >>  8) & 0xFF;
521
522    if (major == 6)
523    {
524      return x >= NDBD_DIH_SUB_GCP_COMPLETE_ACK_63;
525    }
526    if (major == 7 && minor == 0)
527    {
528      return x >= NDBD_DIH_SUB_GCP_COMPLETE_ACK_70;
529    }
530    return x >= NDBD_DIH_SUB_GCP_COMPLETE_ACK_71;
531  }
532}
533
534/**
535 * After this version, TC/BACKUP/SUMA does not use ScanFragReq::setAttrLen
536 *   when sending long SCAN_FRAGREQ
537 */
538#define NDBD_LONG_SCAN_FRAGREQ_70 NDB_MAKE_VERSION(7,0,20)
539#define NDBD_LONG_SCAN_FRAGREQ_71 NDB_MAKE_VERSION(7,1,9)
540
541#define NDBD_FAIL_REP_SOURCE_NODE_63 NDB_MAKE_VERSION(6,3,40)
542#define NDBD_FAIL_REP_SOURCE_NODE_70 NDB_MAKE_VERSION(7,0,21)
543#define NDBD_FAIL_REP_SOURCE_NODE_71 NDB_MAKE_VERSION(7,1,10)
544
545static
546inline
547int
548ndbd_fail_rep_source_node(Uint32 x)
549{
550  {
551    const Uint32 major = (x >> 16) & 0xFF;
552    const Uint32 minor = (x >>  8) & 0xFF;
553
554    if (major == 6)
555    {
556      return x >= NDBD_FAIL_REP_SOURCE_NODE_63;
557    }
558    if (major == 7 && minor == 0)
559    {
560      return x >= NDBD_FAIL_REP_SOURCE_NODE_70;
561    }
562    return x >= NDBD_FAIL_REP_SOURCE_NODE_71;
563  }
564}
565
566
567#define NDBD_SYNC_REQ_SUPPORT_70 NDB_MAKE_VERSION(7,0,20)
568#define NDBD_SYNC_REQ_SUPPORT_71 NDB_MAKE_VERSION(7,1,9)
569
570static
571inline
572int
573ndbd_sync_req_support(Uint32 x)
574{
575  const Uint32 major = (x >> 16) & 0xFF;
576  const Uint32 minor = (x >>  8) & 0xFF;
577
578  if (major == 7 && minor == 0)
579    return x >= NDBD_SYNC_REQ_SUPPORT_70;
580
581  return x >= NDBD_SYNC_REQ_SUPPORT_71;
582}
583
584/**
585 * Does not support CopyFragReq::CFR_NON_TRANSACTIONAL
586 */
587#define NDBD_NON_TRANS_COPY_FRAG_REQ_70 NDB_MAKE_VERSION(7,0,22)
588#define NDBD_NON_TRANS_COPY_FRAG_REQ_71 NDB_MAKE_VERSION(7,1,11)
589
590static
591inline
592int
593ndbd_non_trans_copy_frag_req(Uint32 x)
594{
595  const Uint32 major = (x >> 16) & 0xFF;
596  const Uint32 minor = (x >>  8) & 0xFF;
597
598  if (major == 7 && minor == 0)
599    return x >= NDBD_NON_TRANS_COPY_FRAG_REQ_70;
600
601  return x >= NDBD_NON_TRANS_COPY_FRAG_REQ_71;
602}
603
604#define NDBD_PING_REQ_70 NDB_MAKE_VERSION(7,0,24)
605#define NDBD_PING_REQ_71 NDB_MAKE_VERSION(7,1,13)
606
607static
608inline
609int
610ndbd_connectivity_check(Uint32 x)
611{
612  const Uint32 major = (x >> 16) & 0xFF;
613  const Uint32 minor = (x >>  8) & 0xFF;
614
615  if (major == 7 && minor == 0)
616    return x >= NDBD_PING_REQ_70;
617
618  return x >= NDBD_PING_REQ_71;
619}
620
621#define NDBD_DEFERRED_UNIQUE_CONSTRAINTS_70 NDB_MAKE_VERSION(7,0,25)
622#define NDBD_DEFERRED_UNIQUE_CONSTRAINTS_71 NDB_MAKE_VERSION(7,1,14)
623
624static
625inline
626int
627ndbd_deferred_unique_constraints(Uint32 x)
628{
629  const Uint32 major = (x >> 16) & 0xFF;
630  const Uint32 minor = (x >>  8) & 0xFF;
631
632  if (major == 7 && minor == 0)
633    return x >= NDBD_DEFERRED_UNIQUE_CONSTRAINTS_70;
634
635  return x >= NDBD_DEFERRED_UNIQUE_CONSTRAINTS_71;
636}
637
638#define NDBD_TUP_EXTRABITS_70 NDB_MAKE_VERSION(7,0,25)
639#define NDBD_TUP_EXTRABITS_71 NDB_MAKE_VERSION(7,1,14)
640#define NDBD_TUP_EXTRABITS_72 NDB_MAKE_VERSION(7,2,1)
641
642static
643inline
644int
645ndb_tup_extrabits(Uint32 x)
646{
647  {
648    const Uint32 major = (x >> 16) & 0xFF;
649    const Uint32 minor = (x >>  8) & 0xFF;
650
651    if (major == 7 && minor < 2)
652    {
653      if (minor == 0)
654        return x >= NDBD_TUP_EXTRABITS_70;
655      else if (minor == 1)
656        return x >= NDBD_TUP_EXTRABITS_71;
657    }
658    return x >= NDBD_TUP_EXTRABITS_72;
659  }
660}
661
662#define NDBD_REFRESH_TUPLE_70 NDB_MAKE_VERSION(7,0,26)
663#define NDBD_REFRESH_TUPLE_71 NDB_MAKE_VERSION(7,1,15)
664#define NDBD_REFRESH_TUPLE_72 NDB_MAKE_VERSION(7,2,1)
665
666static
667inline
668int
669ndb_refresh_tuple(Uint32 x)
670{
671  {
672    const Uint32 major = (x >> 16) & 0xFF;
673    const Uint32 minor = (x >>  8) & 0xFF;
674
675    if (major == 7 && minor < 2)
676    {
677      if (minor == 0)
678        return x >= NDBD_REFRESH_TUPLE_70;
679      else if (minor == 1)
680        return x >= NDBD_REFRESH_TUPLE_71;
681    }
682    return x >= NDBD_REFRESH_TUPLE_72;
683  }
684}
685
686#define NDBD_GET_CONFIG_SUPPORT_70 NDB_MAKE_VERSION(7,0,27)
687#define NDBD_GET_CONFIG_SUPPORT_71 NDB_MAKE_VERSION(7,1,16)
688
689static
690inline
691int
692ndbd_get_config_supported(Uint32 x)
693{
694  const Uint32 major = (x >> 16) & 0xFF;
695  const Uint32 minor = (x >>  8) & 0xFF;
696
697  if (major == 7 && minor == 0)
698    return x >= NDBD_GET_CONFIG_SUPPORT_70;
699
700  return x >= NDBD_GET_CONFIG_SUPPORT_71;
701}
702
703#endif
704