MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TcKeyConf.cpp
1 /*
2  Copyright (C) 2003-2007 MySQL AB
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #include <signaldata/TcKeyConf.hpp>
20 #include <BlockNumbers.h>
21 
22 bool
23 printTCKEYCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
24 
25 
26  if (receiverBlockNo == API_PACKED) {
27  return false;
28  Uint32 Theader = * theData++;
29  Uint32 TpacketLen = (Theader & 0x1F) + 3;
30  Uint32 TrecBlockNo = Theader >> 16;
31 
32  do {
33  fprintf(output, "Block: %d %d %d\n", TrecBlockNo, len, TpacketLen);
34  printTCKEYCONF(output, theData, TpacketLen, TrecBlockNo);
35  assert(len >= (1 + TpacketLen));
36  len -= (1 + TpacketLen);
37  theData += TpacketLen;
38  } while(len);
39  return true;
40  }
41  else {
42  const TcKeyConf * const sig = (TcKeyConf *) theData;
43 
44  Uint32 i = 0;
45  Uint32 confInfo = sig->confInfo;
46  Uint32 noOfOp = TcKeyConf::getNoOfOperations(confInfo);
47  if (noOfOp > 10) noOfOp = 10;
48  fprintf(output, " apiConnectPtr: H'%.8x, gci: %u/%u, transId:(H'%.8x, H'%.8x)\n",
49  sig->apiConnectPtr,
50  sig->gci_hi, *(Uint32*)&sig->operations[noOfOp],
51  sig->transId1, sig->transId2);
52 
53  fprintf(output, " noOfOperations: %u, commitFlag: %s, markerFlag: %s\n",
54  noOfOp,
55  (TcKeyConf::getCommitFlag(confInfo) == 0)?"false":"true",
56  (TcKeyConf::getMarkerFlag(confInfo) == 0)?"false":"true");
57  fprintf(output, "Operations:\n");
58  for(i = 0; i < noOfOp; i++) {
59  if(sig->operations[i].attrInfoLen > TcKeyConf::DirtyReadBit)
60  fprintf(output,
61  " apiOperationPtr: H'%.8x, simplereadnode: %u\n",
62  sig->operations[i].apiOperationPtr,
63  sig->operations[i].attrInfoLen & (~TcKeyConf::DirtyReadBit));
64  else
65  fprintf(output,
66  " apiOperationPtr: H'%.8x, attrInfoLen: %u\n",
67  sig->operations[i].apiOperationPtr,
68  sig->operations[i].attrInfoLen);
69  }
70  }
71 
72  return true;
73 }