1 /*
2    Copyright (c) 2003, 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 DROP_TRIG_HPP
26 #define DROP_TRIG_HPP
27 
28 #include "SignalData.hpp"
29 #include <NodeBitmask.hpp>
30 #include <trigger_definitions.h>
31 
32 #define JAM_FILE_ID 71
33 
34 
35 struct DropTrigReq
36 {
37   enum EndpointFlag
38   {
39     MainTrigger = 0,
40     TriggerDst = 1, // TC  "consuming" block(s)
41     TriggerSrc = 2  // LQH "producing" block(s)
42   };
43 
getEndpointFlagDropTrigReq44   static Uint32 getEndpointFlag(Uint32 i) { return (i >> 2) & 3;}
setEndpointFlagDropTrigReq45   static void setEndpointFlag(Uint32 & i, Uint32 v) { i |= ((v & 3) << 2); }
46 
47   STATIC_CONST( SignalLength = 11 );
48   SECTION( TRIGGER_NAME_SECTION = 0 ); // optional
49 
50   Uint32 clientRef;
51   Uint32 clientData;
52   Uint32 transId;
53   Uint32 transKey;
54   Uint32 requestInfo;
55   Uint32 tableId;
56   Uint32 tableVersion;
57   Uint32 indexId;
58   Uint32 indexVersion;
59   Uint32 triggerNo;
60   Uint32 triggerId;
61 };
62 
63 struct DropTrigConf {
64   STATIC_CONST( SignalLength = 6 );
65 
66   Uint32 senderRef;
67   union { Uint32 clientData, senderData; };
68   Uint32 transId;
69   Uint32 tableId;
70   Uint32 indexId;
71   Uint32 triggerId;
72 };
73 
74 struct DropTrigRef {
75   enum ErrorCode {
76     NoError = 0,
77     Busy = 701,
78     TriggerNotFound = 4238,
79     BadRequestType = 4247,
80     InvalidName = 4248,
81     InvalidTable = 4249,
82     UnsupportedTriggerType = 4240
83   };
84 
85   STATIC_CONST( SignalLength = 11 );
86 
87   Uint32 senderRef;
88   union { Uint32 clientData, senderData; };
89   Uint32 transId;
90   Uint32 tableId;
91   Uint32 indexId;
92   Uint32 triggerId;
93   Uint32 errorCode;
94   Uint32 errorLine;
95   Uint32 errorNodeId;
96   Uint32 masterNodeId;
97 };
98 
99 
100 #undef JAM_FILE_ID
101 
102 #endif
103