~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/ndb/include/ndb_version.h.in

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#ifndef NDB_VERSION_H
 
17
#define NDB_VERSION_H
 
18
 
 
19
#include <ndb_types.h>
 
20
 
 
21
/* NDB build version */
 
22
#define NDB_VERSION_BUILD @NDB_VERSION_BUILD@
 
23
 
 
24
/* NDB major version */
 
25
#define NDB_VERSION_MAJOR @NDB_VERSION_MAJOR@
 
26
 
 
27
/* NDB minor version */
 
28
#define NDB_VERSION_MINOR @NDB_VERSION_MINOR@
 
29
 
 
30
/* NDB status version */
 
31
#define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@"
 
32
 
 
33
 
 
34
#define NDB_MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8)  | ((C) << 0))
 
35
 
 
36
#define NDB_VERSION_D NDB_MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD)
 
37
#define NDB_VERSION_STRING_BUF_SZ 100
 
38
#ifdef __cplusplus
 
39
extern "C" {
 
40
#endif
 
41
 
 
42
void ndbPrintVersion();
 
43
 
 
44
Uint32 ndbMakeVersion(Uint32 major, Uint32 minor, Uint32 build);
 
45
 
 
46
Uint32 ndbGetMajor(Uint32 version);
 
47
  
 
48
Uint32 ndbGetMinor(Uint32 version);
 
49
  
 
50
Uint32 ndbGetBuild(Uint32 version);
 
51
 
 
52
const char* ndbGetVersionString(Uint32 version, const char * status,
 
53
                                char *buf, unsigned sz);
 
54
const char* ndbGetOwnVersionString();
 
55
 
 
56
Uint32 ndbGetOwnVersion();
 
57
 
 
58
#ifdef __cplusplus
 
59
}
 
60
#endif
 
61
 
 
62
#define NDB_VERSION_STRING ndbGetOwnVersionString()
 
63
 
 
64
#define NDB_VERSION ndbGetOwnVersion()
 
65
 
 
66
/**
 
67
 * Version id 
 
68
 *
 
69
 *  Used by transporter and when communicating with
 
70
 *     managment server
 
71
 */
 
72
/*#define NDB_VERSION_ID 0*/
 
73
 
 
74
/**
 
75
 * From which version do we support rowid
 
76
 */ 
 
77
#define NDBD_ROWID_VERSION (NDB_MAKE_VERSION(5,1,6))
 
78
#define NDBD_INCL_NODECONF_VERSION_4 NDB_MAKE_VERSION(4,1,17)
 
79
#define NDBD_INCL_NODECONF_VERSION_5 NDB_MAKE_VERSION(5,0,18)
 
80
#define NDBD_FRAGID_VERSION (NDB_MAKE_VERSION(5,1,6))
 
81
#define NDBD_DICT_LOCK_VERSION_5 NDB_MAKE_VERSION(5,0,23)
 
82
#define NDBD_DICT_LOCK_VERSION_5_1 NDB_MAKE_VERSION(5,1,12)
 
83
 
 
84
#define NDBD_UPDATE_FRAG_DIST_KEY_50 NDB_MAKE_VERSION(5,0,26)
 
85
#define NDBD_UPDATE_FRAG_DIST_KEY_51 NDB_MAKE_VERSION(5,1,12)
 
86
 
 
87
#define NDBD_QMGR_SINGLEUSER_VERSION_5 NDB_MAKE_VERSION(5,0,25)
 
88
 
 
89
#define NDBD_NODE_VERSION_REP NDB_MAKE_VERSION(6,1,1)
 
90
 
 
91
#define NDBD_PREPARE_COPY_FRAG_VERSION NDB_MAKE_VERSION(6,2,1)
 
92
#define NDBD_PREPARE_COPY_FRAG_V2_51 NDB_MAKE_VERSION(5,1,23)
 
93
#define NDBD_PREPARE_COPY_FRAG_V2_62 NDB_MAKE_VERSION(6,2,8)
 
94
#define NDBD_PREPARE_COPY_FRAG_V2_63 NDB_MAKE_VERSION(6,3,6)
 
95
 
 
96
/**
 
97
 * 0 = NO PREP COPY FRAG SUPPORT
 
98
 * 1 = NO MAX PAGE SUPPORT
 
99
 * 2 = LATEST VERSION
 
100
 */
 
101
static
 
102
inline
 
103
int
 
104
ndb_check_prep_copy_frag_version(Uint32 version)
 
105
{       
 
106
  const Uint32 major = (version >> 16) & 0xFF;
 
107
  const Uint32 minor = (version >>  8) & 0xFF;
 
108
 
 
109
  if (version == NDB_VERSION_D)
 
110
    return 2;
 
111
 
 
112
  if (major >= 6)
 
113
  {
 
114
    if (minor == 2)
 
115
    {
 
116
      if (version >= NDBD_PREPARE_COPY_FRAG_V2_62)
 
117
        return 2;
 
118
      if (version >= NDBD_PREPARE_COPY_FRAG_VERSION)
 
119
        return 1;
 
120
      return 0;
 
121
    }
 
122
    else if (minor == 3)
 
123
    {
 
124
      if (version >= NDBD_PREPARE_COPY_FRAG_V2_63)
 
125
        return 2;
 
126
      return 1;
 
127
    }
 
128
    return 2;
 
129
  }
 
130
  else if (major == 5 && minor == 1)
 
131
  {
 
132
    if (version >= NDBD_PREPARE_COPY_FRAG_V2_51)
 
133
      return 2;
 
134
  }
 
135
    
 
136
  return 0;
 
137
}
 
138
 
 
139
#endif
 
140