MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CreateTrig.cpp
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 #include <signaldata/CreateTrig.hpp>
19 #include <signaldata/DictSignal.hpp>
20 #include <trigger_definitions.h>
21 
22 bool
23 printCREATE_TRIG_REQ(FILE* output, const Uint32* theData, Uint32 len, Uint16)
24 {
25  const CreateTrigReq* sig = (const CreateTrigReq*)theData;
26  const Uint32 triggerType =
27  TriggerInfo::getTriggerType(sig->triggerInfo);
28  const Uint32 triggerActionTime =
29  TriggerInfo::getTriggerActionTime(sig->triggerInfo);
30  const Uint32 triggerEvent =
31  TriggerInfo::getTriggerEvent(sig->triggerInfo);
32  const Uint32 monitorReplicas =
33  TriggerInfo::getMonitorReplicas(sig->triggerInfo);
34  const Uint32 monitorAllAttributes =
35  TriggerInfo::getMonitorAllAttributes(sig->triggerInfo);
36  const Uint32 reportAllMonitoredAttributes =
37  TriggerInfo::getReportAllMonitoredAttributes(sig->triggerInfo);
38  fprintf(output, " clientRef: 0x%x", sig->clientRef);
39  fprintf(output, " clientData: %u", sig->clientData);
40  fprintf(output, "\n");
41  fprintf(output, " transId: 0x%x", sig->transId);
42  fprintf(output, " transKey: %u", sig->transKey);
43  fprintf(output, "\n");
44  fprintf(output, " requestInfo: type: %u extra: %u flags: [%s]",
45  DictSignal::getRequestType(sig->requestInfo),
46  DictSignal::getRequestExtra(sig->requestInfo),
47  DictSignal::getRequestFlagsText(sig->requestInfo));
48  fprintf(output, "\n");
49  fprintf(output, " tableId: %u", sig->tableId);
50  fprintf(output, " tableVersion: 0x%x", sig->tableVersion);
51  fprintf(output, " indexId: %u", sig->indexId);
52  fprintf(output, " indexVersion: 0x%x", sig->indexVersion);
53  fprintf(output, " triggerNo: %u", sig->triggerNo);
54  fprintf(output, "\n");
55  if (sig->forceTriggerId == RNIL)
56  fprintf(output, " forceTriggerId: RNIL");
57  else
58  fprintf(output, " forceTriggerId: %u", sig->forceTriggerId);
59  fprintf(output, "\n");
60  fprintf(output, " triggerInfo: 0x%x", sig->triggerInfo);
61  fprintf(output, "\n");
62  fprintf(output, " triggerType: %u [%s]",
63  triggerType,
64  TriggerInfo::triggerTypeName(triggerType));
65  fprintf(output, "\n");
66  fprintf(output, " triggerActionTime: %u [%s]",
67  triggerActionTime,
68  TriggerInfo::triggerActionTimeName(triggerActionTime));
69  fprintf(output, "\n");
70  fprintf(output, " triggerEvent: %u [%s]",
71  triggerEvent,
72  TriggerInfo::triggerEventName(triggerEvent));
73  fprintf(output, "\n");
74  fprintf(output, " monitorReplicas: %u",
75  monitorReplicas);
76  fprintf(output, "\n");
77  fprintf(output, " monitorAllAttributes: %u",
78  monitorAllAttributes);
79  fprintf(output, "\n");
80  fprintf(output, " reportAllMonitoredAttributes: %u",
81  reportAllMonitoredAttributes);
82  fprintf(output, "\n");
83  fprintf(output, " receiverRef: 0x%x", sig->receiverRef);
84  fprintf(output, "\n");
85  return true;
86 }
87 
88 bool
89 printCREATE_TRIG_CONF(FILE* output, const Uint32* theData, Uint32 len, Uint16)
90 {
91  const CreateTrigConf* sig = (const CreateTrigConf*)theData;
92  fprintf(output, " senderRef: 0x%x", sig->senderRef);
93  fprintf(output, " clientData: %x", sig->clientData);
94  fprintf(output, " transId: 0x%x", sig->transId);
95  fprintf(output, "\n");
96  fprintf(output, " tableId: %u", sig->tableId);
97  fprintf(output, " indexId: %u", sig->indexId);
98  fprintf(output, " triggerId: %u", sig->triggerId);
99  fprintf(output, " triggerInfo: 0x%x", sig->triggerInfo);
100  fprintf(output, "\n");
101  return true;
102 }
103 
104 bool
105 printCREATE_TRIG_REF(FILE* output, const Uint32* theData, Uint32 len, Uint16)
106 {
107  const CreateTrigRef* sig = (CreateTrigRef*)theData;
108  fprintf(output, " senderRef: 0x%x", sig->senderRef);
109  fprintf(output, " clientData: %u", sig->clientData);
110  fprintf(output, " transId: 0x%x", sig->transId);
111  fprintf(output, "\n");
112  fprintf(output, " tableId: %u", sig->tableId);
113  fprintf(output, " indexId: %u", sig->indexId);
114  fprintf(output, " triggerInfo: 0x%x", sig->triggerInfo);
115  fprintf(output, "\n");
116  fprintf(output, " errorCode: %u", sig->errorCode);
117  fprintf(output, " errorLine: %u", sig->errorLine);
118  fprintf(output, " errorNodeId: %u", sig->errorNodeId);
119  fprintf(output, " masterNodeId: %u", sig->masterNodeId);
120  fprintf(output, "\n");
121  return true;
122 }