1 /*
2    Copyright (c) 2003, 2013, 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 LQH_FRAG_HPP
26 #define LQH_FRAG_HPP
27 
28 #include "SignalData.hpp"
29 
30 #define JAM_FILE_ID 44
31 
32 
33 class AddFragReq {
34   /**
35    * Sender(s)
36    */
37   friend class Dbdih;
38 
39   /**
40    * Receiver(s)
41    */
42   friend class Dbdict;
43 
44   friend bool printADD_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16);
45 
46 public:
47   STATIC_CONST( SignalLength = 12 );
48 
49   enum RequestInfo {
50     CreateInRunning = 0x8000000,
51     TemporaryTable  = 0x00000010
52   };
53 private:
54   Uint32 dihPtr;
55   Uint32 senderData; // The same data as sent in DIADDTABREQ
56   Uint32 fragmentId;
57   Uint32 requestInfo;
58   Uint32 tableId;
59   Uint32 nextLCP;
60   Uint32 nodeId;
61   Uint32 totalFragments;
62   Uint32 startGci;
63   Uint32 tablespaceId;
64   Uint32 logPartId;
65   Uint32 changeMask;
66 };
67 
68 class AddFragRef {
69   /**
70    * Sender(s)
71    */
72   friend class Dbdict;
73 
74   /**
75    * Receiver(s)
76    */
77   friend class Dbdih;
78 
79   friend bool printADD_FRAG_REF(FILE *, const Uint32 *, Uint32, Uint16);
80 public:
81   STATIC_CONST( SignalLength = 2 );
82 
83 private:
84   Uint32 dihPtr;
85   Uint32 fragId;
86 };
87 
88 class AddFragConf {
89   /**
90    * Sender(s)
91    */
92   friend class Dbdict;
93 
94   /**
95    * Receiver(s)
96    */
97   friend class Dbdih;
98 
99   friend bool printADD_FRAG_CONF(FILE *, const Uint32 *, Uint32, Uint16);
100 public:
101   STATIC_CONST( SignalLength = 2 );
102 
103 private:
104   Uint32 dihPtr;
105   Uint32 fragId;
106 };
107 
108 class LqhFragReq {
109   /**
110    * Sender(s)
111    */
112   friend class Dbdict;
113 
114   /**
115    * Receiver(s)
116    */
117   friend class Dblqh;
118   friend class DblqhProxy;
119 
120   friend bool printLQH_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16);
121 
122 public:
123   STATIC_CONST( SignalLength = 22 );
124 
125   enum RequestInfo {
126     CreateInRunning = 0x8000000,
127     TemporaryTable = 0x00000010
128   };
129 
130 private:
131   Uint32 senderData;
132   Uint32 senderRef;
133   Uint32 tableId;
134   Uint32 tableVersion;
135 
136   Uint32 nextLCP;
137   Uint32 startGci;
138   union {
139     Uint32 fragmentId;
140     Uint32 fragId;
141   };
142   Uint32 requestInfo;
143 
144   Uint32 localKeyLength;
145   Uint32 lh3DistrBits;
146   Uint32 lh3PageBits;
147   Uint32 keyLength;
148   Uint32 maxLoadFactor;
149   Uint32 minLoadFactor;
150   Uint32 kValue;
151 
152   Uint32 logPartId;
153   Uint32 tablespace_id;       // RNIL for MM table
154   Uint32 maxRowsLow;
155   Uint32 maxRowsHigh;
156   Uint32 minRowsLow;
157   Uint32 minRowsHigh;
158   Uint32 changeMask;
159 };
160 
161 class LqhFragConf {
162   /**
163    * Sender(s)
164    */
165   friend class Dblqh;
166   friend class DblqhProxy;
167 
168   /**
169    * Receiver(s)
170    */
171   friend class Dbdict;
172 
173   friend bool printLQH_FRAG_CONF(FILE *, const Uint32 *, Uint32, Uint16);
174 public:
175   STATIC_CONST( SignalLength = 5 );
176 
177 private:
178   Uint32 senderData;
179   Uint32 lqhFragPtr;
180   Uint32 tableId;
181   Uint32 fragId;
182   Uint32 changeMask;
183 };
184 
185 class LqhFragRef {
186   /**
187    * Sender(s)
188    */
189   friend class Dblqh;
190   friend class DblqhProxy;
191 
192   /**
193    * Receiver(s)
194    */
195   friend class Dbdict;
196 
197   friend bool printLQH_FRAG_REF(FILE *, const Uint32 *, Uint32, Uint16);
198 public:
199   STATIC_CONST( SignalLength = 6 );
200 
201 private:
202   Uint32 senderData;
203   Uint32 errorCode;
204   Uint32 tableId;
205   Uint32 fragId;
206   Uint32 requestInfo;
207   Uint32 changeMask;
208 };
209 
210 class LqhAddAttrReq {
211   /**
212    * Sender(s)
213    */
214   friend class Dbdict;
215 
216   /**
217    * Receiver(s)
218    */
219   friend class Dblqh;
220   friend class DblqhProxy;
221 
222   friend bool printLQH_ADD_ATTR_REQ(FILE *, const Uint32 *, Uint32, Uint16);
223 public:
224   STATIC_CONST( HeaderLength = 4 );
225   STATIC_CONST( EntryLength = 3 );
226   STATIC_CONST( MAX_ATTRIBUTES = 6 );
227   STATIC_CONST( DEFAULT_VALUE_SECTION_NUM = 0 );
228   struct Entry {
229     Uint32 attrId;              // for index, includes primary attr id << 16
230     Uint32 attrDescriptor;      // 2 words type info
231     Uint32 extTypeInfo;
232   };
233 private:
234   Uint32 lqhFragPtr;
235   Uint32 noOfAttributes;
236   Uint32 senderData;
237   Uint32 senderAttrPtr;
238   Entry attributes[MAX_ATTRIBUTES];
239 };
240 
241 class LqhAddAttrRef {
242   /**
243    * Sender(s)
244    */
245   friend class Dblqh;
246   friend class DblqhProxy;
247 
248   /**
249    * Receiver(s)
250    */
251   friend class Dbdict;
252 
253   friend bool printLQH_ADD_ATTR_REF(FILE *, const Uint32 *, Uint32, Uint16);
254 public:
255   STATIC_CONST( SignalLength = 2 );
256 
257 private:
258   Uint32 senderData;
259   Uint32 errorCode;
260 };
261 
262 class LqhAddAttrConf {
263   /**
264    * Sender(s)
265    */
266   friend class Dblqh;
267   friend class DblqhProxy;
268 
269   /**
270    * Receiver(s)
271    */
272   friend class Dbdict;
273 
274   friend bool printLQH_ADD_ATTR_CONF(FILE *, const Uint32 *, Uint32, Uint16);
275 public:
276   STATIC_CONST( SignalLength = 2 );
277 
278 private:
279   Uint32 senderData;
280   Uint32 senderAttrPtr;
281 };
282 
283 struct DropFragReq
284 {
285   STATIC_CONST( SignalLength = 5 );
286   enum RequestInfo
287   {
288     AlterTableAbort = 0x1
289   };
290   Uint32 senderRef;
291   Uint32 senderData;
292   Uint32 tableId;
293   Uint32 fragId;
294   Uint32 requestInfo;
295 };
296 
297 struct DropFragRef
298 {
299   STATIC_CONST( SignalLength = 5 );
300   Uint32 senderRef;
301   Uint32 senderData;
302   Uint32 tableId;
303   Uint32 fragId;
304   Uint32 errCode;
305 };
306 
307 struct DropFragConf
308 {
309   STATIC_CONST( SignalLength = 4 );
310   Uint32 senderRef;
311   Uint32 senderData;
312   Uint32 tableId;
313   Uint32 fragId;
314 };
315 
316 
317 #undef JAM_FILE_ID
318 
319 #endif
320