~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/ndb/src/common/debugger/signaldata/ScanTab.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
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 as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
 
 
17
 
 
18
#include <BlockNumbers.h>
 
19
#include <signaldata/ScanTab.hpp>
 
20
#include <signaldata/ScanFrag.hpp>
 
21
 
 
22
bool
 
23
printSCANTABREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
 
24
  
 
25
  const ScanTabReq * const sig = (ScanTabReq *) theData;
 
26
  
 
27
  const UintR requestInfo = sig->requestInfo;
 
28
 
 
29
  fprintf(output, " apiConnectPtr: H\'%.8x", 
 
30
          sig->apiConnectPtr);
 
31
  fprintf(output, " requestInfo: H\'%.8x:\n",  requestInfo);
 
32
  fprintf(output, "  Parallellism: %u Batch: %u LockMode: %u Keyinfo: %u Holdlock: %u RangeScan: %u Descending: %u TupScan: %u\n ReadCommitted: %u DistributionKeyFlag: %u NoDisk: %u",
 
33
          sig->getParallelism(requestInfo), 
 
34
          sig->getScanBatch(requestInfo), 
 
35
          sig->getLockMode(requestInfo), 
 
36
          sig->getKeyinfoFlag(requestInfo),
 
37
          sig->getHoldLockFlag(requestInfo), 
 
38
          sig->getRangeScanFlag(requestInfo),
 
39
          sig->getDescendingFlag(requestInfo),
 
40
          sig->getTupScanFlag(requestInfo),
 
41
          sig->getReadCommittedFlag(requestInfo),
 
42
          sig->getDistributionKeyFlag(requestInfo),
 
43
          sig->getNoDiskFlag(requestInfo));
 
44
  
 
45
  if(sig->getDistributionKeyFlag(requestInfo))
 
46
    fprintf(output, " DKey: %x", sig->distributionKey);
 
47
  
 
48
  Uint32 keyLen = (sig->attrLenKeyLen >> 16);
 
49
  Uint32 attrLen = (sig->attrLenKeyLen & 0xFFFF);
 
50
  fprintf(output, " attrLen: %d, keyLen: %d tableId: %d, tableSchemaVer: %d\n",
 
51
          attrLen, keyLen, sig->tableId, sig->tableSchemaVersion);
 
52
  
 
53
  fprintf(output, " transId(1, 2): (H\'%.8x, H\'%.8x) storedProcId: H\'%.8x\n",
 
54
          sig->transId1, sig->transId2, sig->storedProcId);
 
55
  fprintf(output, " batch_byte_size: %d, first_batch_size: %d\n",
 
56
          sig->batch_byte_size, sig->first_batch_size);
 
57
  return false;
 
58
}
 
59
 
 
60
bool
 
61
printSCANTABCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
 
62
  
 
63
  const ScanTabConf * const sig = (ScanTabConf *) theData;
 
64
  
 
65
  const UintR requestInfo = sig->requestInfo;
 
66
 
 
67
  fprintf(output, " apiConnectPtr: H\'%.8x\n", 
 
68
          sig->apiConnectPtr);
 
69
  fprintf(output, " transId(1, 2): (H\'%.8x, H\'%.8x)\n",
 
70
          sig->transId1, sig->transId2);
 
71
 
 
72
  fprintf(output, " requestInfo: Eod: %d OpCount: %d\n", 
 
73
          (requestInfo & ScanTabConf::EndOfData) == ScanTabConf::EndOfData,
 
74
          (requestInfo & (~ScanTabConf::EndOfData)));
 
75
  size_t op_count= requestInfo & (~ScanTabConf::EndOfData);
 
76
  if(op_count){
 
77
    fprintf(output, " Operation(s) [api tc rows len]:\n");
 
78
    ScanTabConf::OpData * op = (ScanTabConf::OpData*)
 
79
      (theData + ScanTabConf::SignalLength);
 
80
    for(size_t i = 0; i<op_count; i++){
 
81
      if(op->info != ScanTabConf::EndOfData)
 
82
        fprintf(output, " [0x%x 0x%x %d %d]",
 
83
                op->apiPtrI, op->tcPtrI,
 
84
                ScanTabConf::getRows(op->info),
 
85
                ScanTabConf::getLength(op->info));
 
86
      else
 
87
        fprintf(output, " [0x%x 0x%x eod]",
 
88
                op->apiPtrI, op->tcPtrI);
 
89
      
 
90
      op++;
 
91
    }
 
92
    fprintf(output, "\n");
 
93
  }
 
94
  return false;
 
95
}
 
96
 
 
97
bool
 
98
printSCANTABREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
 
99
  
 
100
  const ScanTabRef * const sig = (ScanTabRef *) theData;
 
101
  
 
102
  fprintf(output, " apiConnectPtr: H\'%.8x\n", 
 
103
          sig->apiConnectPtr);
 
104
 
 
105
  fprintf(output, " transId(1, 2): (H\'%.8x, H\'%.8x)\n",
 
106
          sig->transId1, sig->transId2);
 
107
  
 
108
  fprintf(output, " Errorcode: %u\n", sig->errorCode);
 
109
  
 
110
  fprintf(output, " closeNeeded: %u\n", sig->closeNeeded);
 
111
  return false;
 
112
}
 
113
 
 
114
 
 
115
bool
 
116
printSCANFRAGNEXTREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
 
117
  const ScanFragNextReq * const sig = (ScanFragNextReq *) theData;
 
118
  
 
119
  fprintf(output, " senderData: H\'%.8x\n", 
 
120
          sig->senderData);
 
121
  
 
122
  fprintf(output, " transId(1, 2): (H\'%.8x, H\'%.8x)\n",
 
123
          sig->transId1, sig->transId2);
 
124
  
 
125
  fprintf(output, " Close scan: %u\n", sig->closeFlag);
 
126
 
 
127
  return false;
 
128
}
 
129
 
 
130
bool
 
131
printSCANNEXTREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
 
132
 
 
133
  if(receiverBlockNo == DBTC){
 
134
    const ScanNextReq * const sig = (ScanNextReq *) theData;
 
135
    
 
136
    fprintf(output, " apiConnectPtr: H\'%.8x\n", 
 
137
            sig->apiConnectPtr);
 
138
    
 
139
    fprintf(output, " transId(1, 2): (H\'%.8x, H\'%.8x) ",
 
140
            sig->transId1, sig->transId2);
 
141
    
 
142
    fprintf(output, " Stop this scan: %u\n", sig->stopScan);
 
143
 
 
144
    const Uint32 * ops = theData + ScanNextReq::SignalLength;
 
145
    if(len > ScanNextReq::SignalLength){
 
146
      fprintf(output, " tcFragPtr(s): ");
 
147
      for(size_t i = ScanNextReq::SignalLength; i<len; i++)
 
148
        fprintf(output, " 0x%x", * ops++);
 
149
      fprintf(output, "\n");
 
150
    }
 
151
  }
 
152
  if (receiverBlockNo == DBLQH){
 
153
    return printSCANFRAGNEXTREQ(output, theData, len, receiverBlockNo);
 
154
  }
 
155
  return false;
 
156
}
 
157