1 /* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
2 
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License, version 2.0,
5    as published by the Free Software Foundation.
6 
7    This program is also distributed with certain software (including
8    but not limited to OpenSSL) that is licensed under separate terms,
9    as designated in a particular file or component or in included license
10    documentation.  The authors of MySQL hereby grant you an additional
11    permission to link the program and your derivative works with the
12    separately licensed software that they have included with MySQL.
13 
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License, version 2.0, for more details.
18 
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
22 
23 #ifndef BUILD_INDX_IMPL_HPP
24 #define BUILD_INDX_IMPL_HPP
25 
26 #include "SignalData.hpp"
27 
28 #define JAM_FILE_ID 30
29 
30 
31 struct BuildIndxImplReq
32 {
33   enum RequestFlag {
34     RF_BUILD_OFFLINE = 1 << 8
35     ,RF_NO_DISK      = 1 << 9         /* Indexed columns are not on disk */
36   };
37 
38   STATIC_CONST( SignalLength = 10 );
39   STATIC_CONST( INDEX_COLUMNS = 0 );
40   STATIC_CONST( KEY_COLUMNS = 1 );
41   STATIC_CONST( NoOfSections = 2 );
42 
43   Uint32 senderRef;
44   Uint32 senderData;
45   Uint32 requestType;
46   Uint32 transId;
47   Uint32 buildId;		// Suma subscription id
48   Uint32 buildKey;		// Suma subscription key
49   Uint32 tableId;
50   Uint32 indexId;
51   Uint32 indexType;
52   Uint32 parallelism;
53 };
54 
55 struct BuildIndxImplConf {
56   STATIC_CONST( SignalLength = 2 );
57 
58   Uint32 senderRef;
59   Uint32 senderData;
60 };
61 
62 struct BuildIndxImplRef {
63   enum ErrorCode {
64     NoError = 0,
65     Busy = 701,
66     NotMaster = 702,
67     BadRequestType = 4247,
68     InvalidPrimaryTable = 4249,
69     InvalidIndexType = 4250,
70     IndexNotUnique = 4251,
71     AllocationFailure = 4252,
72     InternalError = 4346
73   };
74 
75   STATIC_CONST( SignalLength = 6 );
76 
77   Uint32 senderRef;
78   Uint32 senderData;
79   Uint32 errorCode;
80   Uint32 errorLine;
81   Uint32 errorNodeId;
82   Uint32 masterNodeId;
83 };
84 
85 struct mt_BuildIndxReq
86 {
87   Uint32 senderRef;
88   Uint32 senderData;
89 
90   Uint32 indexId;
91   Uint32 tableId;
92   Uint32 fragId;
93 
94   void * tux_ptr;              // ptr to Dbtux
95   void * tup_ptr;
96   Uint32 (* func_ptr)(void *); // c-function
97 
98   void * mem_buffer;  // allocated by FS
99   Uint32 buffer_size; //
100 
101   Uint32 pad[3];
102 
103   STATIC_CONST( SignalLength = (6 + 3 + 4 * (sizeof(void*) / 4)));
104 };
105 
106 
107 #undef JAM_FILE_ID
108 
109 #endif
110