1 /* Copyright (C) 2007, 2008 MySQL AB, 2008 Sun Microsystems, Inc.
2     All rights reserved. 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, 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 Street, Fifth Floor, Boston, MA 02110-1301, USA */
23 
24 #ifndef SCHEMA_TRANS_HPP
25 #define SCHEMA_TRANS_HPP
26 
27 #include "SignalData.hpp"
28 
29 // begin
30 
31 struct SchemaTransBeginReq {
32   STATIC_CONST( SignalLength = 3 );
33   Uint32 clientRef;
34   Uint32 transId;
35   Uint32 requestInfo;
36 };
37 
38 struct SchemaTransBeginConf {
39   STATIC_CONST( SignalLength = 3 );
40   Uint32 senderRef;
41   Uint32 transId;
42   Uint32 transKey;
43 };
44 
45 struct SchemaTransBeginRef {
46   STATIC_CONST( SignalLength = 6 );
47   enum ErrorCode {
48     NoError = 0,
49     NotMaster = 702,
50     Busy = 701,
51     BusyWithNR = 711,
52     TooManySchemaTrans = 780,
53     IncompatibleVersions = 763,
54     Nodefailure = 786
55   };
56   Uint32 senderRef;
57   Uint32 transId;
58   Uint32 errorCode;
59   Uint32 errorLine;
60   Uint32 errorNodeId;
61   Uint32 masterNodeId;
62 };
63 
64 // commit, abort
65 
66 struct SchemaTransEndReq {
67   // must match NdbDictionary::Dictionary::SchemaTransFlag
68   enum Flag {
69     SchemaTransAbort = 1,
70     SchemaTransBackground = 2,
71     SchemaTransPrepare = 4 // Only run prepare
72   };
73   STATIC_CONST( SignalLength = 5 );
74   Uint32 clientRef;
75   Uint32 transId;
76   Uint32 requestInfo;
77   Uint32 transKey;
78   Uint32 flags;
79 };
80 
81 struct SchemaTransEndConf {
82   STATIC_CONST( SignalLength = 2 );
83   Uint32 senderRef;
84   Uint32 transId;
85 };
86 
87 struct SchemaTransEndRef {
88   enum ErrorCode {
89     NoError = 0,
90     NotMaster = 702,
91     InvalidTransKey = 781,
92     InvalidTransId = 782,
93     InvalidTransState = 784
94   };
95   STATIC_CONST( SignalLength = 6 );
96   Uint32 senderRef;
97   Uint32 transId;
98   Uint32 errorCode;
99   Uint32 errorLine;
100   Uint32 errorNodeId;
101   Uint32 masterNodeId;
102 };
103 
104 struct SchemaTransEndRep {
105   enum ErrorCode {
106     NoError = 0,
107     TransAborted = 787
108   };
109   STATIC_CONST( SignalLength = 6 );
110   Uint32 senderRef;
111   Uint32 transId;
112   Uint32 errorCode;
113   Uint32 errorLine;
114   Uint32 errorNodeId;
115   Uint32 masterNodeId;
116 };
117 
118 #endif
119