MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CreateTrig.hpp
1 /*
2  Copyright (c) 2003, 2010, 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 as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef CREATE_TRIG_HPP
19 #define CREATE_TRIG_HPP
20 
21 #include "SignalData.hpp"
22 #include <Bitmask.hpp>
23 #include <trigger_definitions.h>
24 #include <AttributeList.hpp>
25 
27 {
28  enum OnlineFlag
29  {
30  CreateTriggerOnline = 1,
31  CreateTriggerOffline = 2
32  };
33 
34  enum EndpointFlag
35  {
36  MainTrigger = 0,
37  TriggerDst = 1, // TC "consuming" block(s)
38  TriggerSrc = 2 // LQH "producing" block(s)
39  };
40 
41  STATIC_CONST( SignalLength = 13 );
42  SECTION( TRIGGER_NAME_SECTION = 0 );
43  SECTION( ATTRIBUTE_MASK_SECTION = 1 );
44 
45  static Uint32 getOnlineFlag(Uint32 i) { return i & 3; }
46  static void setOnlineFlag(Uint32 & i, Uint32 v) { i |= (v & 3); }
47  static Uint32 getEndpointFlag(Uint32 i) { return (i >> 2) & 3;}
48  static void setEndpointFlag(Uint32 & i, Uint32 v) { i |= ((v & 3) << 2); }
49 
50  Uint32 clientRef;
51  Uint32 clientData;
52 
53  Uint32 transId;
54  Uint32 transKey;
55  Uint32 requestInfo;
56  Uint32 tableId;
57  Uint32 tableVersion;
58  Uint32 indexId; // only for index trigger
59  Uint32 indexVersion;
60  Uint32 triggerNo; // only for index trigger
61  Uint32 forceTriggerId;// only for NR/SR
62  Uint32 triggerInfo; // type | timing | event | flags
63  Uint32 receiverRef; // receiver for subscription trigger
64 };
65 
67  STATIC_CONST( SignalLength = 7 );
68 
69  Uint32 senderRef;
70  union { Uint32 clientData, senderData; };
71  Uint32 transId;
72  Uint32 tableId;
73  Uint32 indexId;
74  Uint32 triggerId;
75  Uint32 triggerInfo;
76 };
77 
79 {
80  enum ErrorCode {
81  NoError = 0,
82  Busy = 701,
83  NotMaster = 702,
84  TriggerNameTooLong = 4236,
85  TooManyTriggers = 4237,
86  TriggerNotFound = 4238,
87  TriggerExists = 4239,
88  UnsupportedTriggerType = 4240,
89  BadRequestType = 4247,
90  InvalidName = 4248,
91  InvalidTable = 4249,
92  OutOfStringBuffer = 773,
93  OutOfSectionMemory = 795
94  };
95 
96  STATIC_CONST( SignalLength = 10 );
97 
98  Uint32 senderRef;
99  union { Uint32 clientData, senderData; };
100  Uint32 transId;
101  Uint32 tableId;
102  Uint32 indexId;
103  Uint32 triggerInfo;
104  Uint32 errorCode;
105  Uint32 errorLine;
106  Uint32 errorNodeId;
107  Uint32 masterNodeId;
108 };
109 
110 #endif