mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / storage / ndb / include / kernel / signaldata / CreateIndx.hpp
blob799bce956c7b7d523a9ad9295699853c3bc1a33b
1 /* Copyright (c) 2003, 2005-2007 MySQL AB
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
16 #ifndef CREATE_INDX_HPP
17 #define CREATE_INDX_HPP
19 #include "SignalData.hpp"
20 #include <NodeBitmask.hpp>
21 #include <signaldata/DictTabInfo.hpp>
23 /**
24 * CreateIndxReq.
26 class CreateIndxReq {
27 friend bool printCREATE_INDX_REQ(FILE*, const Uint32*, Uint32, Uint16);
29 public:
30 enum RequestType {
31 RT_UNDEFINED = 0,
32 RT_USER = 1,
33 RT_DICT_PREPARE = 1 << 4,
34 RT_DICT_COMMIT = 0xC << 4,
35 RT_DICT_ABORT = 0xF << 4,
36 RT_TC = 5 << 8
38 STATIC_CONST( SignalLength = 8 );
39 SECTION( ATTRIBUTE_LIST_SECTION = 0 );
40 SECTION( INDEX_NAME_SECTION = 1 );
42 private:
43 Uint32 m_connectionPtr; // user "schema connection"
44 Uint32 m_userRef; // user block reference
45 Uint32 m_requestInfo;
46 Uint32 m_tableId; // table to index
47 Uint32 m_indexType; // from DictTabInfo::TableType
48 Uint32 m_indexId; // index table id set by DICT
49 Uint32 m_indexVersion; // index table version set by DICT
50 Uint32 m_online; // alter online
51 // extra
52 Uint32 m_opKey;
54 public:
55 Uint32 getUserRef() const {
56 return m_userRef;
58 void setUserRef(Uint32 val) {
59 m_userRef = val;
61 Uint32 getConnectionPtr() const {
62 return m_connectionPtr;
64 void setConnectionPtr(Uint32 val) {
65 m_connectionPtr = val;
67 CreateIndxReq::RequestType getRequestType() const {
68 const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16);
69 return (CreateIndxReq::RequestType)val;
71 void setRequestType(CreateIndxReq::RequestType val) {
72 m_requestInfo = (Uint32)val;
74 Uint32 getRequestFlag() const {
75 return BitmaskImpl::getField(1, &m_requestInfo, 16, 16);
77 void addRequestFlag(Uint32 val) {
78 val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16);
79 BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val);
81 Uint32 getTableId() const {
82 return m_tableId;
84 void setTableId(Uint32 val) {
85 m_tableId = val;
87 DictTabInfo::TableType getIndexType() const {
88 return (DictTabInfo::TableType)m_indexType;
90 void setIndexType(DictTabInfo::TableType val) {
91 m_indexType = (Uint32)val;
93 Uint32 getIndexId() const {
94 return m_indexId;
96 void setIndexId(Uint32 val) {
97 m_indexId = val;
99 Uint32 getOnline() const {
100 return m_online;
102 void setOnline(Uint32 val) {
103 m_online = val;
105 Uint32 getIndexVersion() const {
106 return m_indexVersion;
108 void setIndexVersion(Uint32 val) {
109 m_indexVersion = val;
111 Uint32 getOpKey() const {
112 return m_opKey;
114 void setOpKey(Uint32 val) {
115 m_opKey = val;
120 * CreateIndxConf.
122 class CreateIndxConf {
123 friend bool printCREATE_INDX_CONF(FILE*, const Uint32*, Uint32, Uint16);
125 public:
126 STATIC_CONST( InternalLength = 3 );
127 STATIC_CONST( SignalLength = 7 );
129 private:
130 Uint32 m_connectionPtr;
131 Uint32 m_userRef;
132 Uint32 m_requestInfo;
133 Uint32 m_tableId;
134 Uint32 m_indexType;
135 Uint32 m_indexId;
136 Uint32 m_indexVersion;
138 public:
139 Uint32 getUserRef() const {
140 return m_userRef;
142 void setUserRef(Uint32 val) {
143 m_userRef = val;
145 Uint32 getConnectionPtr() const {
146 return m_connectionPtr;
148 void setConnectionPtr(Uint32 val) {
149 m_connectionPtr = val;
151 CreateIndxReq::RequestType getRequestType() const {
152 return (CreateIndxReq::RequestType)m_requestInfo;
154 void setRequestType(CreateIndxReq::RequestType val) {
155 m_requestInfo = (Uint32)val;
157 Uint32 getTableId() const {
158 return m_tableId;
160 void setTableId(Uint32 val) {
161 m_tableId = val;
163 DictTabInfo::TableType getIndexType() const {
164 return (DictTabInfo::TableType)m_indexType;
166 void setIndexType(DictTabInfo::TableType val) {
167 m_indexType = (Uint32)val;
169 Uint32 getIndexId() const {
170 return m_indexId;
172 void setIndexId(Uint32 val) {
173 m_indexId = val;
175 Uint32 getIndexVersion() const {
176 return m_indexVersion;
178 void setIndexVersion(Uint32 val) {
179 m_indexVersion = val;
184 * CreateIndxRef.
186 struct CreateIndxRef {
187 friend bool printCREATE_INDX_REF(FILE*, const Uint32*, Uint32, Uint16);
189 public:
190 STATIC_CONST( SignalLength = CreateIndxReq::SignalLength + 3 );
191 enum ErrorCode {
192 NoError = 0,
193 Busy = 701,
194 BusyWithNR = 711,
195 NotMaster = 702,
196 IndexOnDiskAttributeError = 756,
197 TriggerNotFound = 4238,
198 TriggerExists = 4239,
199 IndexNameTooLong = 4241,
200 TooManyIndexes = 4242,
201 IndexExists = 4244,
202 AttributeNullable = 4246,
203 BadRequestType = 4247,
204 InvalidName = 4248,
205 InvalidPrimaryTable = 4249,
206 InvalidIndexType = 4250,
207 NotUnique = 4251,
208 AllocationError = 4252,
209 CreateIndexTableFailed = 4253,
210 DuplicateAttributes = 4258,
211 SingleUser = 299,
212 TableIsTemporary = 776,
213 TableIsNotTemporary = 777,
214 NoLoggingTemporaryIndex = 778
217 CreateIndxConf m_conf;
218 //Uint32 m_userRef;
219 //Uint32 m_connectionPtr;
220 //Uint32 m_requestInfo;
221 //Uint32 m_tableId;
222 //Uint32 m_indexType;
223 //Uint32 m_indexId;
224 //Uint32 m_indexVersion;
225 Uint32 m_errorCode;
226 Uint32 m_errorLine;
227 union {
228 Uint32 m_errorNode;
229 Uint32 masterNodeId; // If NotMaster
231 public:
232 CreateIndxConf* getConf() {
233 return &m_conf;
235 const CreateIndxConf* getConf() const {
236 return &m_conf;
238 Uint32 getUserRef() const {
239 return m_conf.getUserRef();
241 void setUserRef(Uint32 val) {
242 m_conf.setUserRef(val);
244 Uint32 getConnectionPtr() const {
245 return m_conf.getConnectionPtr();
247 void setConnectionPtr(Uint32 val) {
248 m_conf.setConnectionPtr(val);
250 CreateIndxReq::RequestType getRequestType() const {
251 return m_conf.getRequestType();
253 void setRequestType(CreateIndxReq::RequestType val) {
254 m_conf.setRequestType(val);
256 Uint32 getTableId() const {
257 return m_conf.getTableId();
259 void setTableId(Uint32 val) {
260 m_conf.setTableId(val);
262 DictTabInfo::TableType getIndexType() const {
263 return m_conf.getIndexType();
265 void setIndexType(DictTabInfo::TableType val) {
266 m_conf.setIndexType(val);
268 Uint32 getIndexId() const {
269 return m_conf.getIndexId();
271 void setIndexId(Uint32 val) {
272 m_conf.setIndexId(val);
274 Uint32 getIndexVersion() const {
275 return m_conf.getIndexVersion();
277 void setIndexVersion(Uint32 val) {
278 m_conf.setIndexVersion(val);
280 CreateIndxRef::ErrorCode getErrorCode() const {
281 return (CreateIndxRef::ErrorCode)m_errorCode;
283 void setErrorCode(CreateIndxRef::ErrorCode val) {
284 m_errorCode = (Uint32)val;
286 Uint32 getErrorLine() const {
287 return m_errorLine;
289 void setErrorLine(Uint32 val) {
290 m_errorLine = val;
292 Uint32 getErrorNode() const {
293 return m_errorNode;
295 void setErrorNode(Uint32 val) {
296 m_errorNode = val;
300 #endif