MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LqhKey.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/LqhKey.hpp>
19 
20 bool
21 printLQHKEYREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
22 
23  const LqhKeyReq * const sig = (LqhKeyReq *) theData;
24 
25  fprintf(output,
26  " ClientPtr = H\'%.8x hashValue = H\'%.8x tcBlockRef = H\'%.8x\n"
27  " transId1 = H\'%.8x transId2 = H\'%.8x savePointId = H\'%.8x\n",
28  sig->clientConnectPtr, // DATA 0
29  sig->hashValue, // DATA 2
30  sig->tcBlockref, // DATA 4
31  sig->transId1, // DATA 7
32  sig->transId2, // DATA 8
33  sig->savePointId // DATA 9
34  );
35 
36  const Uint32 reqInfo = sig->requestInfo;
37  const Uint32 attrLen = sig->attrLen;
38 
39  fprintf(output,
40  " Op: %d Lock: %d Flags: ",
41  LqhKeyReq::getOperation(reqInfo),
42  LqhKeyReq::getLockType(reqInfo));
43  if(LqhKeyReq::getSimpleFlag(reqInfo))
44  fprintf(output, "Simple ");
45  if(LqhKeyReq::getDirtyFlag(reqInfo))
46  {
47  if (LqhKeyReq::getNormalProtocolFlag(reqInfo))
48  fprintf(output, "Dirty(N) ");
49  else
50  fprintf(output, "Dirty ");
51  }
52  if(LqhKeyReq::getInterpretedFlag(reqInfo))
53  fprintf(output, "Interpreted ");
54  if(LqhKeyReq::getScanTakeOverFlag(attrLen))
55  fprintf(output, "ScanTakeOver ");
56  if(LqhKeyReq::getMarkerFlag(reqInfo))
57  fprintf(output, "CommitAckMarker ");
58  if(LqhKeyReq::getNoDiskFlag(reqInfo))
59  fprintf(output, "NoDisk ");
60  if(LqhKeyReq::getRowidFlag(reqInfo))
61  fprintf(output, "Rowid ");
62  if(LqhKeyReq::getNrCopyFlag(reqInfo))
63  fprintf(output, "NrCopy ");
64  if(LqhKeyReq::getGCIFlag(reqInfo))
65  fprintf(output, "GCI ");
66  if(LqhKeyReq::getQueueOnRedoProblemFlag(reqInfo))
67  fprintf(output, "Queue ");
68  if(LqhKeyReq::getDeferredConstraints(reqInfo))
69  fprintf(output, "Deferred-constraints ");
70 
71  fprintf(output, "ScanInfo/noFiredTriggers: H\'%x\n", sig->scanInfo);
72 
73  fprintf(output,
74  " AttrLen: %d (%d in this) KeyLen: %d TableId: %d SchemaVer: %d\n",
75  LqhKeyReq::getAttrLen(attrLen),
76  LqhKeyReq::getAIInLqhKeyReq(reqInfo),
77  LqhKeyReq::getKeyLen(reqInfo),
78  LqhKeyReq::getTableId(sig->tableSchemaVersion),
79  LqhKeyReq::getSchemaVersion(sig->tableSchemaVersion));
80 
81  fprintf(output,
82  " FragId: %d ReplicaNo: %d LastReplica: %d NextNodeId: %d\n",
83  LqhKeyReq::getFragmentId(sig->fragmentData),
84  LqhKeyReq::getSeqNoReplica(reqInfo),
85  LqhKeyReq::getLastReplicaNo(reqInfo),
86  LqhKeyReq::getNextReplicaNodeId(sig->fragmentData));
87 
88  bool printed = false;
89  Uint32 nextPos = LqhKeyReq::getApplicationAddressFlag(reqInfo) << 1;
90  if(nextPos != 0){
91  fprintf(output,
92  " ApiRef: H\'%.8x ApiOpRef: H\'%.8x",
93  sig->variableData[0],
94  sig->variableData[1]);
95  printed = true;
96  }
97 
98  if(LqhKeyReq::getSameClientAndTcFlag(reqInfo)){
99  fprintf(output, " TcOpRec: H\'%.8x", sig->variableData[nextPos]);
100  nextPos++;
101  printed = true;
102  }
103 
104  Uint32 tmp = LqhKeyReq::getLastReplicaNo(reqInfo) -
105  LqhKeyReq::getSeqNoReplica(reqInfo);
106  if(tmp > 1){
107  NodeId node2 = sig->variableData[nextPos] & 0xffff;
108  NodeId node3 = sig->variableData[nextPos] >> 16;
109  fprintf(output, " NextNodeId2: %d NextNodeId3: %d",
110  node2, node3);
111  nextPos ++;
112  printed = true;
113  }
114  if(printed)
115  fprintf(output, "\n");
116 
117  printed = false;
118  if(LqhKeyReq::getStoredProcFlag(attrLen)){
119  fprintf(output, " StoredProcId: %d", sig->variableData[nextPos]);
120  nextPos++;
121  printed = true;
122  }
123 
124  if(LqhKeyReq::getReturnedReadLenAIFlag(reqInfo)){
125  fprintf(output, " ReturnedReadLenAI: %d",
126  sig->variableData[nextPos]);
127  nextPos++;
128  printed = true;
129  }
130 
131  const UintR keyLen = LqhKeyReq::getKeyLen(reqInfo);
132  if(keyLen > 0){
133  fprintf(output, " KeyInfo: ");
134  for(UintR i = 0; i<keyLen && i<4; i++, nextPos++)
135  fprintf(output, "H\'%.8x ", sig->variableData[nextPos]);
136  fprintf(output, "\n");
137  }
138 
139  if (LqhKeyReq::getRowidFlag(reqInfo))
140  {
141  fprintf(output, " Rowid: [ page: %d idx: %d ]\n",
142  sig->variableData[nextPos + 0],
143  sig->variableData[nextPos + 1]);
144  nextPos += 2;
145  }
146 
147  if (LqhKeyReq::getGCIFlag(reqInfo))
148  {
149  fprintf(output, " GCI: %u", sig->variableData[nextPos + 0]);
150  nextPos++;
151  }
152 
153  if (LqhKeyReq::getCorrFactorFlag(reqInfo))
154  {
155  fprintf(output, " corrFactorLo: 0x%x", sig->variableData[nextPos + 0]);
156  nextPos++;
157  fprintf(output, " corrFactorHi: 0x%x", sig->variableData[nextPos + 0]);
158  nextPos++;
159  }
160 
161  if(!LqhKeyReq::getInterpretedFlag(reqInfo)){
162  fprintf(output, " AttrInfo: ");
163  for(int i = 0; i<LqhKeyReq::getAIInLqhKeyReq(reqInfo); i++, nextPos++)
164  fprintf(output, "H\'%.8x ", sig->variableData[nextPos]);
165  fprintf(output, "\n");
166  } else {
167  /* Only have section sizes if it's a short LQHKEYREQ */
168  if (LqhKeyReq::getAIInLqhKeyReq(reqInfo) == LqhKeyReq::MaxAttrInfo)
169  {
170  fprintf(output, " InitialReadSize: %d InterpretedSize: %d "
171  "FinalUpdateSize: %d FinalReadSize: %d SubroutineSize: %d\n",
172  sig->variableData[nextPos+0], sig->variableData[nextPos+1],
173  sig->variableData[nextPos+2], sig->variableData[nextPos+3],
174  sig->variableData[nextPos+4]);
175  nextPos += 5;
176  }
177  }
178  return true;
179 }
180 
181 bool
182 printLQHKEYCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
183 // const LqhKeyConf * const sig = (LqhKeyConf *) theData;
184 
185  fprintf(output, "Signal data: ");
186  Uint32 i = 0;
187  while (i < len)
188  fprintf(output, "H\'%.8x ", theData[i++]);
189  fprintf(output,"\n");
190 
191  return true;
192 }
193 
194 bool
195 printLQHKEYREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
196 // const LqhKeyRef * const sig = (LqhKeyRef *) theData;
197 
198  fprintf(output, "Signal data: ");
199  Uint32 i = 0;
200  while (i < len)
201  fprintf(output, "H\'%.8x ", theData[i++]);
202  fprintf(output,"\n");
203 
204  return true;
205 }