18 #ifndef ALTER_TABLE_HPP
19 #define ALTER_TABLE_HPP
21 #include "SignalData.hpp"
24 STATIC_CONST( SignalLength = 8 );
35 SECTION( DICT_TAB_INFO = 0 );
56 #define NAME_SHIFT (0)
58 #define FRAG_DATA_SHIFT (2)
59 #define RANGE_LIST_SHIFT (3)
60 #define TS_NAME_SHIFT (4)
62 #define ADD_ATTR_SHIFT (6)
63 #define ADD_FRAG_SHIFT (7)
64 #define REORG_FRAG_SHIFT (8)
65 #define REORG_COMMIT_SHIFT (9)
66 #define REORG_COMPLETE_SHIFT (10)
67 #define REORG_SUMA_ENABLE (11)
68 #define REORG_SUMA_FILTER (12)
74 static void setNameFlag(UintR & changeMask, Uint32 nameFlg);
75 static Uint8 getFrmFlag(
const UintR & changeMask);
76 static void setFrmFlag(UintR & changeMask, Uint32 frmFlg);
77 static Uint8 getFragDataFlag(
const UintR & changeMask);
78 static void setFragDataFlag(UintR & changeMask, Uint32 fragFlg);
79 static Uint8 getRangeListFlag(
const UintR & changeMask);
80 static void setRangeListFlag(UintR & changeMask, Uint32 rangeFlg);
81 static Uint8 getTsNameFlag(
const UintR & changeMask);
82 static void setTsNameFlag(UintR & changeMask, Uint32 tsNameFlg);
83 static Uint8 getTsFlag(
const UintR & changeMask);
84 static void setTsFlag(UintR & changeMask, Uint32 tsFlg);
85 static Uint8 getAddAttrFlag(
const UintR & changeMask);
86 static void setAddAttrFlag(UintR & changeMask, Uint32 tsFlg);
87 static Uint8 getAddFragFlag(
const UintR & changeMask);
88 static void setAddFragFlag(UintR & changeMask, Uint32 tsFlg);
89 static Uint8 getReorgFragFlag(
const UintR & changeMask);
90 static void setReorgFragFlag(UintR & changeMask, Uint32 tsFlg);
91 static Uint8 getReorgCommitFlag(
const UintR & changeMask);
92 static void setReorgCommitFlag(UintR & changeMask, Uint32 tsFlg);
93 static Uint8 getReorgCompleteFlag(
const UintR & changeMask);
94 static void setReorgCompleteFlag(UintR & changeMask, Uint32 tsFlg);
95 static Uint8 getReorgSumaEnableFlag(
const UintR & changeMask);
96 static void setReorgSumaEnableFlag(UintR & changeMask, Uint32 tsFlg);
97 static Uint8 getReorgSumaFilterFlag(
const UintR & changeMask);
98 static void setReorgSumaFilterFlag(UintR & changeMask, Uint32 tsFlg);
100 static bool getReorgSubOp(
const UintR & changeMask){
102 getReorgCommitFlag(changeMask) ||
103 getReorgCompleteFlag(changeMask) ||
104 getReorgSumaEnableFlag(changeMask) ||
105 getReorgSumaFilterFlag(changeMask);
111 AlterTableReq::getTsFlag(
const UintR & changeMask){
112 return (Uint8)((changeMask >> TS_SHIFT) & 1);
117 AlterTableReq::setTsFlag(UintR & changeMask, Uint32 tsFlg){
118 changeMask |= (tsFlg << TS_SHIFT);
124 return (Uint8)((changeMask >> NAME_SHIFT) & 1);
129 AlterTableReq::setNameFlag(UintR & changeMask, Uint32 nameFlg){
130 changeMask |= (nameFlg << NAME_SHIFT);
135 AlterTableReq::getFrmFlag(
const UintR & changeMask){
136 return (Uint8)((changeMask >> FRM_SHIFT) & 1);
141 AlterTableReq::setFrmFlag(UintR & changeMask, Uint32 frmFlg){
142 changeMask |= (frmFlg << FRM_SHIFT);
147 AlterTableReq::getFragDataFlag(
const UintR & changeMask){
148 return (Uint8)((changeMask >> FRAG_DATA_SHIFT) & 1);
153 AlterTableReq::setFragDataFlag(UintR & changeMask, Uint32 fragDataFlg){
154 changeMask |= (fragDataFlg << FRAG_DATA_SHIFT);
159 AlterTableReq::getRangeListFlag(
const UintR & changeMask){
160 return (Uint8)((changeMask >> RANGE_LIST_SHIFT) & 1);
165 AlterTableReq::setRangeListFlag(UintR & changeMask, Uint32 rangeFlg){
166 changeMask |= (rangeFlg << RANGE_LIST_SHIFT);
171 AlterTableReq::getTsNameFlag(
const UintR & changeMask){
172 return (Uint8)((changeMask >> TS_NAME_SHIFT) & 1);
177 AlterTableReq::setTsNameFlag(UintR & changeMask, Uint32 tsNameFlg){
178 changeMask |= (tsNameFlg << TS_NAME_SHIFT);
183 AlterTableReq::getAddAttrFlag(
const UintR & changeMask){
184 return (Uint8)((changeMask >> ADD_ATTR_SHIFT) & 1);
189 AlterTableReq::setAddAttrFlag(UintR & changeMask, Uint32 addAttrFlg){
190 changeMask |= (addAttrFlg << ADD_ATTR_SHIFT);
195 AlterTableReq::getAddFragFlag(
const UintR & changeMask){
196 return (Uint8)((changeMask >> ADD_FRAG_SHIFT) & 1);
201 AlterTableReq::setAddFragFlag(UintR & changeMask, Uint32 addAttrFlg){
202 changeMask |= (addAttrFlg << ADD_FRAG_SHIFT);
207 AlterTableReq::getReorgFragFlag(
const UintR & changeMask){
208 return (Uint8)((changeMask >> REORG_FRAG_SHIFT) & 1);
213 AlterTableReq::setReorgFragFlag(UintR & changeMask, Uint32 reorgAttrFlg){
214 changeMask |= (reorgAttrFlg << REORG_FRAG_SHIFT);
219 AlterTableReq::getReorgCommitFlag(
const UintR & changeMask){
220 return (Uint8)((changeMask >> REORG_COMMIT_SHIFT) & 1);
225 AlterTableReq::setReorgCommitFlag(UintR & changeMask, Uint32 reorgAttrFlg){
226 changeMask |= (reorgAttrFlg << REORG_COMMIT_SHIFT);
232 AlterTableReq::getReorgCompleteFlag(
const UintR & changeMask){
233 return (Uint8)((changeMask >> REORG_COMPLETE_SHIFT) & 1);
238 AlterTableReq::setReorgCompleteFlag(UintR & changeMask, Uint32 reorgAttrFlg){
239 changeMask |= (reorgAttrFlg << REORG_COMPLETE_SHIFT);
244 AlterTableReq::getReorgSumaEnableFlag(
const UintR & changeMask){
245 return (Uint8)((changeMask >> REORG_SUMA_ENABLE) & 1);
250 AlterTableReq::setReorgSumaEnableFlag(UintR & changeMask, Uint32 reorgAttrFlg){
251 changeMask |= (reorgAttrFlg << REORG_SUMA_ENABLE);
256 AlterTableReq::getReorgSumaFilterFlag(
const UintR & changeMask){
257 return (Uint8)((changeMask >> REORG_SUMA_FILTER) & 1);
262 AlterTableReq::setReorgSumaFilterFlag(UintR & changeMask, Uint32 reorgAttrFlg){
263 changeMask |= (reorgAttrFlg << REORG_SUMA_FILTER);
267 STATIC_CONST( SignalLength = 6 );
277 Uint32 newTableVersion;
281 STATIC_CONST( SignalLength = 9 );
285 InvalidTableVersion = 241,
286 DropInProgress = 283,
291 AttributeNameTooLong = 704,
292 TableNameTooLong = 705,
294 NoMoreTableRecords = 707,
295 NoMoreAttributeRecords = 708,
297 AttributeNameTwice = 720,
298 TableAlreadyExist = 721,
299 ArraySizeTooBig = 737,
301 InvalidPrimaryKeySize = 739,
302 NullablePrimaryKey = 740,
303 UnsupportedChange = 741,
304 BackupInProgress = 762,
305 IncompatibleVersions = 763,
307 TableDefinitionTooBig = 793
329 friend bool printALTER_TABLE_REP(FILE*,
const Uint32*, Uint32, Uint16);
331 STATIC_CONST( SignalLength = 3 );
343 SECTION( TABLE_NAME = 0 );