1 /*
2    Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
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 
26 #ifndef BUILD_FK_IMPL_HPP
27 #define BUILD_FK_IMPL_HPP
28 
29 #include "SignalData.hpp"
30 
31 #define JAM_FILE_ID 207
32 
33 
34 struct BuildFKImplReq
35 {
36   /**
37    * Sender(s) / Reciver(s)
38    */
39   friend class Dbdict;
40 
41   /**
42    * For printing
43    */
44   friend bool printBUILD_FK_IMPL_REQ(FILE*, const Uint32*, Uint32, Uint16);
45 
46   STATIC_CONST( SignalLength = 8 );
47   STATIC_CONST( PARENT_COLUMNS_SEC = 0 );
48   STATIC_CONST( CHILD_COLUMNS_SEC = 1 );
49 
50   enum {
51     RT_PARSE    = 0x1,
52     RT_PREPARE  = 0x2,
53     RT_ABORT    = 0x3,
54     RT_COMMIT   = 0x4,
55     RT_COMPLETE = 0x5
56   };
57 
58   Uint32 senderData;
59   Uint32 senderRef;
60   Uint32 transId;
61   Uint32 requestType;
62   Uint32 fkId;
63   Uint32 fkVersion;
64   Uint32 parentTableId; // could be unique index...
65   Uint32 childTableId;
66 };
67 
68 struct BuildFKImplRef
69 {
70   /**
71    * Sender(s)
72    */
73   friend class Dbdict;
74 
75   /**
76    * For printing
77    */
78   friend bool printBUILD_FK_IMPL_REF(FILE*, const Uint32*, Uint32, Uint16);
79 
80   STATIC_CONST( SignalLength = 3 );
81 
82   enum ErrorCode {
83     NoError = 0
84   };
85 
86   Uint32 senderData;
87   Uint32 senderRef;
88   Uint32 errorCode;
89 };
90 
91 struct BuildFKImplConf
92 {
93   /**
94    * Sender(s)
95    */
96   friend class Dbdict;
97 
98   /**
99    * For printing
100    */
101   friend bool printBUILD_FK_IMPL_CONF(FILE*, const Uint32*, Uint32, Uint16);
102 
103   STATIC_CONST( SignalLength = 4 );
104 
105   Uint32 senderData;
106   Uint32 senderRef;
107 };
108 
109 
110 #undef JAM_FILE_ID
111 
112 #endif
113