1 /*
2    Copyright (c) 2003, 2021, Oracle and/or its affiliates.
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 TUP_FRAG_HPP
26 #define TUP_FRAG_HPP
27 
28 #include "SignalData.hpp"
29 
30 #define JAM_FILE_ID 197
31 
32 
33 /*
34  * Add fragment and add attribute signals between LQH and TUP,TUX.
35  * NOTE: return signals from TUP,TUX to LQH must have same format.
36  */
37 
38 // TUP: add fragment
39 
40 class TupFragReq {
41   friend class Dblqh;
42   friend class Dbtup;
43 public:
44   STATIC_CONST( SignalLength = 11 );
45 private:
46   Uint32 userPtr;
47   Uint32 userRef;
48   Uint32 reqInfo;
49   Uint32 tableId;
50   Uint32 fragId;
51   Uint32 maxRowsLow;
52   Uint32 maxRowsHigh;
53   Uint32 minRowsLow;
54   Uint32 minRowsHigh;
55   Uint32 tablespaceid;
56   Uint32 changeMask;
57 };
58 
59 class TupFragConf {
60   friend class Dblqh;
61   friend class Dbtup;
62 public:
63   STATIC_CONST( SignalLength = 4 );
64 private:
65   Uint32 userPtr;
66   Uint32 tupConnectPtr;
67   Uint32 fragPtr;
68   Uint32 fragId;
69 };
70 
71 class TupFragRef {
72   friend class Dblqh;
73   friend class Dbtup;
74 public:
75   STATIC_CONST( SignalLength = 2 );
76 private:
77   Uint32 userPtr;
78   Uint32 errorCode;
79 };
80 
81 // TUX: add fragment
82 
83 class TuxFragReq {
84   friend class Dblqh;
85   friend class Dbtux;
86 public:
87   STATIC_CONST( SignalLength = 9 );
88 private:
89   Uint32 userPtr;
90   Uint32 userRef;
91   Uint32 reqInfo;
92   Uint32 tableId;
93   Uint32 fragId;
94   Uint32 primaryTableId;
95   Uint32 tupIndexFragPtrI;
96   Uint32 tupTableFragPtrI;
97   Uint32 accTableFragPtrI;
98 };
99 
100 class TuxFragConf {
101   friend class Dblqh;
102   friend class Dbtux;
103 public:
104   STATIC_CONST( SignalLength = 4 );
105 private:
106   Uint32 userPtr;
107   Uint32 tuxConnectPtr;
108   Uint32 fragPtr;
109   Uint32 fragId;
110 };
111 
112 class TuxFragRef {
113   friend class Dblqh;
114   friend class Dbtux;
115 public:
116   STATIC_CONST( SignalLength = 2 );
117   enum ErrorCode {
118     NoError = 0,
119     InvalidRequest = 903,
120     NoFreeFragment = 904,
121     NoFreeAttributes = 905
122   };
123 private:
124   Uint32 userPtr;
125   Uint32 errorCode;
126 };
127 
128 // TUP: add attribute
129 
130 class TupAddAttrReq {
131   friend class Dblqh;
132   friend class Dbtux;
133 public:
134   STATIC_CONST( SignalLength = 5 );
135   STATIC_CONST( DEFAULT_VALUE_SECTION_NUM = 0 );
136 private:
137   Uint32 tupConnectPtr;
138   Uint32 notused1;
139   Uint32 attrId;
140   Uint32 attrDescriptor;
141   Uint32 extTypeInfo;
142 };
143 
144 class TupAddAttrConf {
145   friend class Dblqh;
146   friend class Dbtup;
147 public:
148   STATIC_CONST( SignalLength = 2 );
149 private:
150   Uint32 userPtr;
151   Uint32 lastAttr; // bool: got last attr and closed frag op
152 };
153 
154 class TupAddAttrRef {
155   friend class Dblqh;
156   friend class Dbtup;
157 public:
158   STATIC_CONST( SignalLength = 2 );
159   enum ErrorCode {
160     NoError = 0,
161     InvalidCharset = 743,
162     TooManyBitsUsed = 831,
163     UnsupportedType = 906
164   };
165 private:
166   Uint32 userPtr;
167   Uint32 errorCode;
168 };
169 
170 // TUX: add attribute
171 
172 class TuxAddAttrReq {
173   friend class Dblqh;
174   friend class Dbtux;
175 public:
176   STATIC_CONST( SignalLength = 6 );
177 private:
178   Uint32 tuxConnectPtr;
179   Uint32 notused1;
180   Uint32 attrId;
181   Uint32 attrDescriptor;
182   Uint32 extTypeInfo;
183   Uint32 primaryAttrId;
184 };
185 
186 class TuxAddAttrConf {
187   friend class Dblqh;
188   friend class Dbtux;
189 public:
190   STATIC_CONST( SignalLength = 2 );
191 private:
192   Uint32 userPtr;
193   Uint32 lastAttr; // bool: got last attr and closed frag op
194 };
195 
196 class TuxAddAttrRef {
197   friend class Dblqh;
198   friend class Dbtux;
199 public:
200   STATIC_CONST( SignalLength = 2 );
201   enum ErrorCode {
202     NoError = 0,
203     InvalidAttributeType = 906,
204     InvalidCharset = 907,
205     InvalidNodeSize = 908
206   };
207 private:
208   Uint32 userPtr;
209   Uint32 errorCode;
210 };
211 
212 
213 #undef JAM_FILE_ID
214 
215 #endif
216