MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TcKeyReq.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 
19 
20 #include <signaldata/TcKeyReq.hpp>
21 
22 bool
23 printTCKEYREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
24 
25  const TcKeyReq * const sig = (TcKeyReq *) theData;
26 
27  UintR requestInfo = sig->requestInfo;
28 
29  fprintf(output, " apiConnectPtr: H\'%.8x, apiOperationPtr: H\'%.8x\n",
30  sig->apiConnectPtr, sig->apiOperationPtr);
31  fprintf(output, " Operation: %s, Flags: ",
32  sig->getOperationType(requestInfo) == ZREAD ? "Read" :
33  sig->getOperationType(requestInfo) == ZREAD_EX ? "Read-Ex" :
34  sig->getOperationType(requestInfo) == ZUPDATE ? "Update" :
35  sig->getOperationType(requestInfo) == ZINSERT ? "Insert" :
36  sig->getOperationType(requestInfo) == ZDELETE ? "Delete" :
37  sig->getOperationType(requestInfo) == ZWRITE ? "Write" :
38  sig->getOperationType(requestInfo) == ZUNLOCK ? "Unlock" :
39  sig->getOperationType(requestInfo) == ZREFRESH ? "Refresh" :
40  "Unknown");
41  {
42  if(sig->getDirtyFlag(requestInfo)){
43  fprintf(output, "Dirty ");
44  }
45  if(sig->getStartFlag(requestInfo)){
46  fprintf(output, "Start ");
47  }
48  if(sig->getExecuteFlag(requestInfo)){
49  fprintf(output, "Execute ");
50  }
51  if(sig->getCommitFlag(requestInfo)){
52  fprintf(output, "Commit ");
53  }
54  if (sig->getNoDiskFlag(requestInfo)) {
55  fprintf(output, "NoDisk ");
56  }
57 
58  UintR TcommitType = sig->getAbortOption(requestInfo);
59  if (TcommitType == TcKeyReq::AbortOnError) {
60  fprintf(output, "AbortOnError ");
61  } else if (TcommitType == TcKeyReq::IgnoreError) {
62  fprintf(output, "IgnoreError ");
63  }//if
64 
65  if(sig->getSimpleFlag(requestInfo)){
66  fprintf(output, "Simple ");
67  }
68  if(sig->getScanIndFlag(requestInfo)){
69  fprintf(output, "ScanInd ");
70  }
71  if(sig->getInterpretedFlag(requestInfo)){
72  fprintf(output, "Interpreted ");
73  }
74  if(sig->getDistributionKeyFlag(sig->requestInfo)){
75  fprintf(output, "d-key ");
76  }
77  if(sig->getViaSPJFlag(sig->requestInfo)){
78  fprintf(output, " spj");
79  }
80  if(sig->getQueueOnRedoProblemFlag(sig->requestInfo))
81  fprintf(output, "Queue ");
82 
83  if(sig->getDeferredConstraints(sig->requestInfo))
84  fprintf(output, "Deferred-constraints ");
85 
86  fprintf(output, "\n");
87  }
88 
89  const int keyLen = sig->getKeyLength(requestInfo);
90  const int attrInThis = sig->getAIInTcKeyReq(requestInfo);
91  const int attrLen = sig->getAttrinfoLen(sig->attrLen);
92  const int apiVer = sig->getAPIVersion(sig->attrLen);
93  fprintf(output,
94  " keyLen: %d, attrLen: %d, AI in this: %d, tableId: %d, "
95  "tableSchemaVer: %d, API Ver: %d\n",
96  keyLen, attrLen, attrInThis,
97  sig->tableId, sig->tableSchemaVersion, apiVer);
98 
99  fprintf(output, " transId(1, 2): (H\'%.8x, H\'%.8x)\n -- Variable Data --\n",
100  sig->transId1, sig->transId2);
101 
102  if (len >= TcKeyReq::StaticLength) {
103  Uint32 restLen = (len - TcKeyReq::StaticLength);
104  const Uint32 * rest = &sig->scanInfo;
105  while(restLen >= 7){
106  fprintf(output,
107  " H\'%.8x H\'%.8x H\'%.8x H\'%.8x H\'%.8x H\'%.8x H\'%.8x\n",
108  rest[0], rest[1], rest[2], rest[3],
109  rest[4], rest[5], rest[6]);
110  restLen -= 7;
111  rest += 7;
112  }
113  if(restLen > 0){
114  for(Uint32 i = 0; i<restLen; i++)
115  fprintf(output, " H\'%.8x", rest[i]);
116  fprintf(output, "\n");
117  }
118  } else {
119  fprintf(output, "*** invalid len %u ***\n", len);
120  }
121  return true;
122 }
123