1 /*
2 Copyright (c) 2004, 2020, 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, 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::getFirstMatchFlag(sig->requestInfo))
57 fprintf(output, "f");
58 if (ScanFragReq::getNoDiskFlag(sig->requestInfo))
59 fprintf(output, "(nodisk)");
60 fprintf(output, " attrLen: %u",
61 ScanFragReq::getAttrLen(sig->requestInfo));
62 fprintf(output, " reorg: %u",
63 ScanFragReq::getReorgFlag(sig->requestInfo));
64 fprintf(output, " corr: %u",
65 ScanFragReq::getCorrFactorFlag(sig->requestInfo));
66 fprintf(output, " mfrag: %u",
67 ScanFragReq::getMultiFragFlag(sig->requestInfo));
68 fprintf(output, " stat: %u",
69 ScanFragReq::getStatScanFlag(sig->requestInfo));
70 fprintf(output, " ni: %u",
71 ScanFragReq::getNotInterpretedFlag(sig->requestInfo));
72 fprintf(output, "\n");
73
74 fprintf(output, " tableId: %u\n", sig->tableId);
75 fprintf(output, " fragmentNo: %u\n", sig->fragmentNoKeyLen & 0xFFFF);
76 fprintf(output, " keyLen: %u\n", sig->fragmentNoKeyLen >> 16);
77 fprintf(output, " schemaVersion: 0x%x\n", sig->schemaVersion);
78 fprintf(output, " transId1: 0x%x\n", sig->transId1);
79 fprintf(output, " transId2: 0x%x\n", sig->transId2);
80 fprintf(output, " clientOpPtr: 0x%x\n", sig->clientOpPtr);
81 fprintf(output, " batch_size_rows: %u\n", sig->batch_size_rows);
82 fprintf(output, " batch_size_bytes: %u\n", sig->batch_size_bytes);
83
84 if (ScanFragReq::getCorrFactorFlag(sig->requestInfo))
85 {
86 fprintf(output, " corrFactorLo: 0x%x\n", sig->variableData[0]);
87 fprintf(output, " corrFactorHi: 0x%x\n", sig->variableData[1]);
88 }
89
90 return true;
91 }
92
93 bool
printSCAN_FRAGCONF(FILE * output,const Uint32 * theData,Uint32 len,Uint16 receiverBlockNo)94 printSCAN_FRAGCONF(FILE * output, const Uint32 * theData,
95 Uint32 len, Uint16 receiverBlockNo)
96 {
97 const ScanFragConf * const sig =
98 reinterpret_cast<const ScanFragConf*>(theData);
99 fprintf(output, " senderData: 0x%x\n", sig->senderData);
100 fprintf(output, " completedOps: %u\n", sig->completedOps);
101 fprintf(output, " fragmentCompleted: 0x%x\n", sig->fragmentCompleted);
102 fprintf(output, " transId1: 0x%x\n", sig->transId1);
103 fprintf(output, " transId2: 0x%x\n", sig->transId2);
104 fprintf(output, " total_len: %u\n", sig->total_len);
105 if (len >= ScanFragConf::SignalLength_ext)
106 fprintf(output, " activeMask: 0x%x\n", sig->activeMask);
107 else
108 fprintf(output, " activeMask: 0(not an ext-signal)");
109
110 return true;
111 }
112