1 /* Copyright (c) 2007, 2021, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
22
23 #include <signaldata/CreateTrigImpl.hpp>
24 #include <trigger_definitions.h>
25
26 bool
printCREATE_TRIG_IMPL_REQ(FILE * output,const Uint32 * theData,Uint32 len,Uint16)27 printCREATE_TRIG_IMPL_REQ(FILE* output, const Uint32* theData, Uint32 len, Uint16)
28 {
29 const CreateTrigImplReq* sig = (const CreateTrigImplReq*)theData;
30 const Uint32 triggerType =
31 TriggerInfo::getTriggerType(sig->triggerInfo);
32 const Uint32 triggerActionTime =
33 TriggerInfo::getTriggerActionTime(sig->triggerInfo);
34 const Uint32 triggerEvent =
35 TriggerInfo::getTriggerEvent(sig->triggerInfo);
36 const Uint32 monitorReplicas =
37 TriggerInfo::getMonitorReplicas(sig->triggerInfo);
38 const Uint32 monitorAllAttributes =
39 TriggerInfo::getMonitorAllAttributes(sig->triggerInfo);
40 const Uint32 reportAllMonitoredAttributes =
41 TriggerInfo::getReportAllMonitoredAttributes(sig->triggerInfo);
42 fprintf(output, " senderRef: 0x%x", sig->senderRef);
43 fprintf(output, " senderData: %u", sig->senderData);
44 fprintf(output, " requestType: %u", sig->requestType);
45 fprintf(output, "\n");
46 fprintf(output, " tableId: %u", sig->tableId);
47 fprintf(output, " tableVersion: 0x%x", sig->tableVersion);
48 fprintf(output, " indexId: %u", sig->indexId);
49 fprintf(output, " indexVersion: 0x%x", sig->indexVersion);
50 fprintf(output, " triggerNo: %u", sig->triggerNo);
51 fprintf(output, "\n");
52 fprintf(output, " triggerId: %u", sig->triggerId);
53 fprintf(output, " triggerInfo: 0x%x", sig->triggerInfo);
54 fprintf(output, "\n");
55 fprintf(output, " triggerType: %u [%s]",
56 triggerType,
57 TriggerInfo::triggerTypeName(triggerType));
58 fprintf(output, "\n");
59 fprintf(output, " triggerActionTime: %u [%s]",
60 triggerActionTime,
61 TriggerInfo::triggerActionTimeName(triggerActionTime));
62 fprintf(output, "\n");
63 fprintf(output, " triggerEvent: %u [%s]",
64 triggerEvent,
65 TriggerInfo::triggerEventName(triggerEvent));
66 fprintf(output, "\n");
67 fprintf(output, " monitorReplicas: %u",
68 monitorReplicas);
69 fprintf(output, "\n");
70 fprintf(output, " monitorAllAttributes: %u",
71 monitorAllAttributes);
72 fprintf(output, "\n");
73 fprintf(output, " reportAllMonitoredAttributes: %u",
74 reportAllMonitoredAttributes);
75 fprintf(output, " receiverRef: 0x%x", sig->receiverRef);
76 fprintf(output, "\n");
77 return true;
78 }
79
80 bool
printCREATE_TRIG_IMPL_CONF(FILE * output,const Uint32 * theData,Uint32 len,Uint16)81 printCREATE_TRIG_IMPL_CONF(FILE* output, const Uint32* theData, Uint32 len, Uint16)
82 {
83 const CreateTrigImplConf* sig = (const CreateTrigImplConf*)theData;
84 fprintf(output, " senderRef: 0x%x", sig->senderRef);
85 fprintf(output, " senderData: %u", sig->senderData);
86 fprintf(output, "\n");
87 fprintf(output, " tableId: %u", sig->tableId);
88 fprintf(output, " triggerId: %u", sig->triggerId);
89 fprintf(output, " triggerInfo: 0x%x", sig->triggerInfo);
90 fprintf(output, "\n");
91 return true;
92 }
93
94 bool
printCREATE_TRIG_IMPL_REF(FILE * output,const Uint32 * theData,Uint32 len,Uint16)95 printCREATE_TRIG_IMPL_REF(FILE* output, const Uint32* theData, Uint32 len, Uint16)
96 {
97 const CreateTrigImplRef* sig = (CreateTrigImplRef*)theData;
98 fprintf(output, " senderRef: 0x%x", sig->senderRef);
99 fprintf(output, " senderData: %u", sig->senderData);
100 fprintf(output, "\n");
101 fprintf(output, " tableId: %u", sig->tableId);
102 fprintf(output, " triggerId: %u", sig->triggerId);
103 fprintf(output, " triggerInfo: 0x%x", sig->triggerInfo);
104 fprintf(output, "\n");
105 fprintf(output, " errorCode: %u", sig->errorCode);
106 fprintf(output, " errorLine: %u", sig->errorLine);
107 fprintf(output, " errorNodeId: %u", sig->errorNodeId);
108 fprintf(output, " masterNodeId: %u", sig->masterNodeId);
109 fprintf(output, "\n");
110 return true;
111 }
112