1 /*
2    Copyright (c) 2005, 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 DICT_OBJ_OP_HPP
26 #define DICT_OBJ_OP_HPP
27 
28 #define JAM_FILE_ID 143
29 
30 
31 struct DictObjOp {
32 
33   enum RequestType {
34     Prepare = 0, // Prepare create obj
35     Commit = 1,  // Commit create obj
36     Abort = 2    // Prepare failed, drop instead
37   };
38 
39   enum State {
40     Defined = 0,
41     Preparing = 1,
42     Prepared = 2,
43     Committing = 3,
44     Committed = 4,
45     Aborting = 5,
46     Aborted = 6
47   };
48 };
49 
50 struct DictCommitReq
51 {
52   Uint32 senderData;
53   Uint32 senderRef;
54   Uint32 op_key;
55 
56   STATIC_CONST( SignalLength = 3 );
57   STATIC_CONST( GSN = GSN_DICT_COMMIT_REQ );
58 };
59 
60 struct DictCommitRef
61 {
62   Uint32 senderData;
63   Uint32 senderRef;
64   Uint32 errorCode;
65   enum ErrorCode
66   {
67     NF_FakeErrorREF = 1
68   };
69   STATIC_CONST( SignalLength = 3 );
70   STATIC_CONST( GSN = GSN_DICT_COMMIT_REF );
71 };
72 
73 struct DictCommitConf
74 {
75   Uint32 senderData;
76   Uint32 senderRef;
77 
78   STATIC_CONST( SignalLength = 2 );
79   STATIC_CONST( GSN = GSN_DICT_COMMIT_CONF );
80 };
81 
82 struct DictAbortReq
83 {
84   Uint32 senderData;
85   Uint32 senderRef;
86   Uint32 op_key;
87 
88   STATIC_CONST( SignalLength = 3 );
89   STATIC_CONST( GSN = GSN_DICT_ABORT_REQ );
90 };
91 
92 struct DictAbortRef
93 {
94   Uint32 senderData;
95   Uint32 senderRef;
96   Uint32 errorCode;
97   enum ErrorCode
98   {
99     NF_FakeErrorREF = 1
100   };
101   STATIC_CONST( SignalLength = 3 );
102   STATIC_CONST( GSN = GSN_DICT_ABORT_REF );
103 };
104 
105 struct DictAbortConf
106 {
107   Uint32 senderData;
108   Uint32 senderRef;
109 
110   STATIC_CONST( SignalLength = 2 );
111   STATIC_CONST( GSN = GSN_DICT_ABORT_CONF );
112 };
113 
114 
115 
116 #undef JAM_FILE_ID
117 
118 #endif
119