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

« back to all changes in this revision

Viewing changes to storage/ndb/include/kernel/signaldata/DropIndx.hpp

  • 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 DROP_INDX_HPP
 
17
#define DROP_INDX_HPP
 
18
 
 
19
#include "SignalData.hpp"
 
20
#include <NodeBitmask.hpp>
 
21
 
 
22
/**
 
23
 * DropIndxReq.
 
24
 */
 
25
class DropIndxReq {
 
26
  friend bool printDROP_INDX_REQ(FILE*, const Uint32*, Uint32, Uint16);
 
27
 
 
28
public:
 
29
  enum RequestType {
 
30
    RT_UNDEFINED = 0,
 
31
    RT_USER = 1,
 
32
    RT_DICT_PREPARE = 1 << 4,
 
33
    RT_DICT_COMMIT = 0xC << 4,
 
34
    RT_DICT_ABORT = 0xF << 4,
 
35
    RT_TC = 5 << 8
 
36
  };
 
37
  STATIC_CONST( SignalLength = 6 );
 
38
 
 
39
private:
 
40
  Uint32 m_connectionPtr;
 
41
  Uint32 m_userRef;
 
42
  Uint32 m_requestInfo;
 
43
  Uint32 m_tableId;
 
44
  Uint32 m_indexId;
 
45
  Uint32 m_indexVersion;
 
46
  // extra
 
47
  Uint32 m_opKey;
 
48
 
 
49
public:
 
50
  Uint32 getConnectionPtr() const {
 
51
    return m_connectionPtr;
 
52
  }
 
53
  void setConnectionPtr(Uint32 val) {
 
54
    m_connectionPtr = val;
 
55
  }
 
56
  Uint32 getUserRef() const {
 
57
    return m_userRef;
 
58
  }
 
59
  void setUserRef(Uint32 val) {
 
60
    m_userRef = val;
 
61
  }
 
62
  DropIndxReq::RequestType getRequestType() const {
 
63
    const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16);
 
64
    return (DropIndxReq::RequestType)val;
 
65
  }
 
66
  void setRequestType(DropIndxReq::RequestType val) {
 
67
    m_requestInfo = (Uint32)val;
 
68
  }
 
69
  Uint32 getRequestFlag() const {
 
70
    return BitmaskImpl::getField(1, &m_requestInfo, 16, 16);
 
71
  };
 
72
  void addRequestFlag(Uint32 val) {
 
73
    val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16);
 
74
    BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val);
 
75
  };
 
76
  Uint32 getTableId() const {
 
77
    return m_tableId;
 
78
  }
 
79
  void setTableId(Uint32 val) {
 
80
    m_tableId = val;
 
81
  }
 
82
  Uint32 getIndexId() const {
 
83
    return m_indexId;
 
84
  }
 
85
  void setIndexId(Uint32 val) {
 
86
    m_indexId = val;
 
87
  }
 
88
  Uint32 getIndexVersion() const {
 
89
    return m_indexVersion;
 
90
  }
 
91
  void setIndexVersion(Uint32 val) {
 
92
    m_indexVersion = val;
 
93
  }
 
94
  Uint32 getOpKey() const {
 
95
    return m_opKey;
 
96
  }
 
97
  void setOpKey(Uint32 val) {
 
98
    m_opKey = val;
 
99
  }
 
100
};
 
101
 
 
102
/**
 
103
 * DropIndxConf.
 
104
 */
 
105
class DropIndxConf {
 
106
  friend bool printDROP_INDX_CONF(FILE*, const Uint32*, Uint32, Uint16);
 
107
 
 
108
public:
 
109
  STATIC_CONST( InternalLength = 3 );
 
110
  STATIC_CONST( SignalLength = 6 );
 
111
 
 
112
private:
 
113
  Uint32 m_connectionPtr;
 
114
  Uint32 m_userRef;
 
115
  Uint32 m_requestInfo;
 
116
  Uint32 m_tableId;
 
117
  Uint32 m_indexId;
 
118
  Uint32 m_indexVersion;
 
119
 
 
120
public:
 
121
  Uint32 getConnectionPtr() const {
 
122
    return m_connectionPtr;
 
123
  }
 
124
  void setConnectionPtr(Uint32 val) {
 
125
    m_connectionPtr = val;
 
126
  }
 
127
  Uint32 getUserRef() const {
 
128
    return m_userRef;
 
129
  }
 
130
  void setUserRef(Uint32 val) {
 
131
    m_userRef = val;
 
132
  }
 
133
  DropIndxReq::RequestType getRequestType() const {
 
134
    return (DropIndxReq::RequestType)m_requestInfo;
 
135
  }
 
136
  void setRequestType(DropIndxReq::RequestType val) {
 
137
    m_requestInfo = val;
 
138
  }
 
139
  Uint32 getTableId() const {
 
140
    return m_tableId;
 
141
  }
 
142
  void setTableId(Uint32 val) {
 
143
    m_tableId = val;
 
144
  }
 
145
  Uint32 getIndexId() const {
 
146
    return m_indexId;
 
147
  }
 
148
  void setIndexId(Uint32 val) {
 
149
    m_indexId = val;
 
150
  }
 
151
  Uint32 getIndexVersion() const {
 
152
    return m_indexVersion;
 
153
  }
 
154
  void setIndexVersion(Uint32 val) {
 
155
    m_indexVersion = val;
 
156
  }
 
157
};
 
158
 
 
159
/**
 
160
 * DropIndxRef.
 
161
 */
 
162
struct DropIndxRef {
 
163
  friend bool printDROP_INDX_REF(FILE*, const Uint32*, Uint32, Uint16);
 
164
 
 
165
public:
 
166
  enum ErrorCode {
 
167
    NoError = 0,
 
168
    InvalidIndexVersion = 241,
 
169
    Busy = 701,
 
170
    BusyWithNR = 711,
 
171
    NotMaster = 702,
 
172
    IndexNotFound = 4243,
 
173
    BadRequestType = 4247,
 
174
    InvalidName = 4248,
 
175
    NotAnIndex = 4254,
 
176
    SingleUser = 299
 
177
  };
 
178
  STATIC_CONST( SignalLength = DropIndxConf::SignalLength + 3 );
 
179
 
 
180
  DropIndxConf m_conf;
 
181
  //Uint32 m_userRef;
 
182
  //Uint32 m_connectionPtr;
 
183
  //Uint32 m_requestInfo;
 
184
  //Uint32 m_tableId;
 
185
  //Uint32 m_indexId;
 
186
  //Uint32 m_indexVersion;
 
187
  Uint32 m_errorCode;
 
188
  Uint32 m_errorLine;
 
189
  union {
 
190
    Uint32 m_errorNode;
 
191
    Uint32 masterNodeId;
 
192
  };
 
193
public:
 
194
  DropIndxConf* getConf() {
 
195
    return &m_conf;
 
196
  }
 
197
  const DropIndxConf* getConf() const {
 
198
    return &m_conf;
 
199
  }
 
200
  Uint32 getConnectionPtr() const {
 
201
    return m_conf.getConnectionPtr();
 
202
  }
 
203
  void setConnectionPtr(Uint32 val) {
 
204
    m_conf.setConnectionPtr(val);
 
205
  }
 
206
  Uint32 getUserRef() const {
 
207
    return m_conf.getUserRef();
 
208
  }
 
209
  void setUserRef(Uint32 val) {
 
210
    m_conf.setUserRef(val);
 
211
  }
 
212
  DropIndxReq::RequestType getRequestType() const {
 
213
    return m_conf.getRequestType();
 
214
  }
 
215
  void setRequestType(DropIndxReq::RequestType val) {
 
216
    m_conf.setRequestType(val);
 
217
  }
 
218
  Uint32 getTableId() const {
 
219
    return m_conf.getTableId();
 
220
  }
 
221
  void setTableId(Uint32 val) {
 
222
    m_conf.setTableId(val);
 
223
  }
 
224
  Uint32 getIndexId() const {
 
225
    return m_conf.getIndexId();
 
226
  }
 
227
  void setIndexId(Uint32 val) {
 
228
    m_conf.setIndexId(val);
 
229
  }
 
230
  Uint32 getIndexVersion() const {
 
231
    return m_conf.getIndexVersion();
 
232
  }
 
233
  void setIndexVersion(Uint32 val) {
 
234
    m_conf.setIndexVersion(val);
 
235
  }
 
236
  DropIndxRef::ErrorCode getErrorCode() const {
 
237
    return (DropIndxRef::ErrorCode)m_errorCode;
 
238
  }
 
239
  void setErrorCode(DropIndxRef::ErrorCode val) {
 
240
    m_errorCode = (Uint32)val;
 
241
  }
 
242
  Uint32 getErrorLine() const {
 
243
    return m_errorLine;
 
244
  }
 
245
  void setErrorLine(Uint32 val) {
 
246
    m_errorLine = val;
 
247
  }
 
248
  Uint32 getErrorNode() const {
 
249
    return m_errorNode;
 
250
  }
 
251
  void setErrorNode(Uint32 val) {
 
252
    m_errorNode = val;
 
253
  }
 
254
};
 
255
 
 
256
#endif