1 /*
2 Copyright (c) 2004, 2021, Oracle and/or its affiliates.
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, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is also distributed with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have included with MySQL.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24
25
26
27 #include <BlockNumbers.h>
28 #include <signaldata/ScanTab.hpp>
29 #include <signaldata/ScanFrag.hpp>
30
31 bool
printSCAN_FRAGREQ(FILE * output,const Uint32 * theData,Uint32 len,Uint16 receiverBlockNo)32 printSCAN_FRAGREQ(FILE * output, const Uint32 * theData,
33 Uint32 len, Uint16 receiverBlockNo) {
34 const ScanFragReq * const sig = (ScanFragReq *)theData;
35 fprintf(output, " senderData: 0x%x\n", sig->senderData);
36 fprintf(output, " resultRef: 0x%x\n", sig->resultRef);
37 fprintf(output, " savePointId: %u\n", sig->savePointId);
38
39 fprintf(output, " flags: ");
40 if (ScanFragReq::getLockMode(sig->requestInfo))
41 fprintf(output, "X");
42 if (ScanFragReq::getPrioAFlag(sig->requestInfo))
43 fprintf(output, "a");
44 if (ScanFragReq::getHoldLockFlag(sig->requestInfo))
45 fprintf(output, "h");
46 if (ScanFragReq::getKeyinfoFlag(sig->requestInfo))
47 fprintf(output, "k");
48 if (ScanFragReq::getReadCommittedFlag(sig->requestInfo))
49 fprintf(output, "d");
50 if (ScanFragReq::getRangeScanFlag(sig->requestInfo))
51 fprintf(output, "r");
52 if (ScanFragReq::getDescendingFlag(sig->requestInfo))
53 fprintf(output, "(desc)");
54 if (ScanFragReq::getTupScanFlag(sig->requestInfo))
55 fprintf(output, "t");
56 if (ScanFragReq::getNoDiskFlag(sig->requestInfo))
57 fprintf(output, "(nodisk)");
58 fprintf(output, " attrLen: %u",
59 ScanFragReq::getAttrLen(sig->requestInfo));
60 fprintf(output, " reorg: %u",
61 ScanFragReq::getReorgFlag(sig->requestInfo));
62 fprintf(output, " corr: %u",
63 ScanFragReq::getCorrFactorFlag(sig->requestInfo));
64 fprintf(output, " stat: %u",
65 ScanFragReq::getStatScanFlag(sig->requestInfo));
66 fprintf(output, " ni: %u",
67 ScanFragReq::getNotInterpretedFlag(sig->requestInfo));
68 fprintf(output, "\n");
69
70 fprintf(output, " tableId: %u\n", sig->tableId);
71 fprintf(output, " fragmentNo: %u\n", sig->fragmentNoKeyLen & 0xFFFF);
72 fprintf(output, " keyLen: %u\n", sig->fragmentNoKeyLen >> 16);
73 fprintf(output, " schemaVersion: 0x%x\n", sig->schemaVersion);
74 fprintf(output, " transId1: 0x%x\n", sig->transId1);
75 fprintf(output, " transId2: 0x%x\n", sig->transId2);
76 fprintf(output, " clientOpPtr: 0x%x\n", sig->clientOpPtr);
77 fprintf(output, " batch_size_rows: %u\n", sig->batch_size_rows);
78 fprintf(output, " batch_size_bytes: %u\n", sig->batch_size_bytes);
79
80 if (ScanFragReq::getCorrFactorFlag(sig->requestInfo))
81 {
82 fprintf(output, " corrFactorLo: 0x%x\n", sig->variableData[0]);
83 fprintf(output, " corrFactorHi: 0x%x\n", sig->variableData[1]);
84 }
85
86 return true;
87 }
88
89 bool
printSCAN_FRAGCONF(FILE * output,const Uint32 * theData,Uint32 len,Uint16 receiverBlockNo)90 printSCAN_FRAGCONF(FILE * output, const Uint32 * theData,
91 Uint32 len, Uint16 receiverBlockNo)
92 {
93 const ScanFragConf * const sig =
94 reinterpret_cast<const ScanFragConf*>(theData);
95 fprintf(output, " senderData: 0x%x\n", sig->senderData);
96 fprintf(output, " completedOps: %u\n", sig->completedOps);
97 fprintf(output, " fragmentCompleted: 0x%x\n", sig->fragmentCompleted);
98 fprintf(output, " transId1: 0x%x\n", sig->transId1);
99 fprintf(output, " transId2: 0x%x\n", sig->transId2);
100 fprintf(output, " total_len: %u\n", sig->total_len);
101
102 return true;
103 }
104