1 /* Copyright (c) 2003-2005 MySQL AB
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
18 #include <signaldata/TcKeyReq.hpp>
21 printTCKEYREQ(FILE * output
, const Uint32
* theData
, Uint32 len
, Uint16 receiverBlockNo
){
23 const TcKeyReq
* const sig
= (TcKeyReq
*) theData
;
25 UintR requestInfo
= sig
->requestInfo
;
27 fprintf(output
, " apiConnectPtr: H\'%.8x, apiOperationPtr: H\'%.8x\n",
28 sig
->apiConnectPtr
, sig
->apiOperationPtr
);
29 fprintf(output
, " Operation: %s, Flags: ",
30 sig
->getOperationType(requestInfo
) == ZREAD
? "Read" :
31 sig
->getOperationType(requestInfo
) == ZREAD_EX
? "Read-Ex" :
32 sig
->getOperationType(requestInfo
) == ZUPDATE
? "Update" :
33 sig
->getOperationType(requestInfo
) == ZINSERT
? "Insert" :
34 sig
->getOperationType(requestInfo
) == ZDELETE
? "Delete" :
35 sig
->getOperationType(requestInfo
) == ZWRITE
? "Write" :
38 if(sig
->getDirtyFlag(requestInfo
)){
39 fprintf(output
, "Dirty ");
41 if(sig
->getStartFlag(requestInfo
)){
42 fprintf(output
, "Start ");
44 if(sig
->getExecuteFlag(requestInfo
)){
45 fprintf(output
, "Execute ");
47 if(sig
->getCommitFlag(requestInfo
)){
48 fprintf(output
, "Commit ");
50 if (sig
->getExecutingTrigger(requestInfo
)) {
51 fprintf(output
, "Trigger ");
54 if (sig
->getNoDiskFlag(requestInfo
)) {
55 fprintf(output
, "NoDisk ");
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 ");
65 if(sig
->getSimpleFlag(requestInfo
)){
66 fprintf(output
, "Simple ");
68 if(sig
->getScanIndFlag(requestInfo
)){
69 fprintf(output
, "ScanInd ");
71 if(sig
->getInterpretedFlag(requestInfo
)){
72 fprintf(output
, "Interpreted ");
74 if(sig
->getDistributionKeyFlag(sig
->requestInfo
)){
75 fprintf(output
, " d-key");
77 fprintf(output
, "\n");
80 const int keyLen
= sig
->getKeyLength(requestInfo
);
81 const int attrInThis
= sig
->getAIInTcKeyReq(requestInfo
);
82 const int attrLen
= sig
->getAttrinfoLen(sig
->attrLen
);
83 const int apiVer
= sig
->getAPIVersion(sig
->attrLen
);
85 " keyLen: %d, attrLen: %d, AI in this: %d, tableId: %d, "
86 "tableSchemaVer: %d, API Ver: %d\n",
87 keyLen
, attrLen
, attrInThis
,
88 sig
->tableId
, sig
->tableSchemaVersion
, apiVer
);
90 fprintf(output
, " transId(1, 2): (H\'%.8x, H\'%.8x)\n -- Variable Data --\n",
91 sig
->transId1
, sig
->transId2
);
93 if (len
>= TcKeyReq::StaticLength
) {
94 Uint32 restLen
= (len
- TcKeyReq::StaticLength
);
95 const Uint32
* rest
= &sig
->scanInfo
;
98 " H\'%.8x H\'%.8x H\'%.8x H\'%.8x H\'%.8x H\'%.8x H\'%.8x\n",
99 rest
[0], rest
[1], rest
[2], rest
[3],
100 rest
[4], rest
[5], rest
[6]);
105 for(Uint32 i
= 0; i
<restLen
; i
++)
106 fprintf(output
, " H\'%.8x", rest
[i
]);
107 fprintf(output
, "\n");
110 fprintf(output
, "*** invalid len %u ***\n", len
);