1 /* Copyright (c) 2003-2005 MySQL AB
2    Use is subject to license terms
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 as published by
6    the Free Software Foundation; version 2 of the License.
7 
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.
12 
13    You should have received a copy of the GNU General Public License
14    along with this program; if not, write to the Free Software
15    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA */
16 
17 #ifndef TUX_MAINT_HPP
18 #define TUX_MAINT_HPP
19 
20 #include "SignalData.hpp"
21 
22 /*
23  * Ordered index maintenance operation.
24  */
25 
26 class TuxMaintReq {
27   friend class Dbtup;
28   friend class Dbtux;
29   friend bool printTUX_MAINT_REQ(FILE*, const Uint32*, Uint32, Uint16);
30 public:
31   enum OpCode {         // first byte of opInfo
32     OpAdd = 1,
33     OpRemove = 2
34   };
35   enum OpFlag {         // second byte of opInfo
36   };
37   enum ErrorCode {
38     NoError = 0,        // must be zero
39     SearchError = 901,  // add + found or remove + not found
40     NoMemError = 902
41   };
42   STATIC_CONST( SignalLength = 8 );
43 
44   /*
45    * Error code set by TUX.  Zero means no error.
46    */
47   Uint32 errorCode;
48   /*
49    * Table, index, fragment.
50    */
51   Uint32 tableId;
52   Uint32 indexId;
53   Uint32 fragId;
54   /*
55    * Tuple version identified by physical address of "original" tuple
56    * and version number.
57    */
58   Uint32 pageId;
59   Uint32 pageIndex;
60   Uint32 tupVersion;
61   /*
62    * Operation code and flags.
63    */
64   Uint32 opInfo;
65 
66   Uint32 tupFragPtrI;
67   Uint32 fragPageId;
68 };
69 
70 #endif
71