MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AccLock.cpp
1 /*
2  Copyright (C) 2003, 2005, 2006 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/AccLock.hpp>
20 #include <SignalLoggerManager.hpp>
21 
22 bool
23 printACC_LOCKREQ(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
24 {
25  const AccLockReq* const sig = (const AccLockReq*)theData;
26  Uint32 reqtype = sig->requestInfo & 0xFF;
27  switch (sig->returnCode) {
28  case RNIL:
29  fprintf(output, " returnCode=RNIL");
30  break;
31  case AccLockReq::Success:
32  fprintf(output, " returnCode=Success");
33  break;
34  case AccLockReq::IsBlocked:
35  fprintf(output, " returnCode=IsBlocked");
36  break;
37  case AccLockReq::WouldBlock:
38  fprintf(output, " returnCode=WouldBlock");
39  break;
40  case AccLockReq::Refused:
41  fprintf(output, " returnCode=Refused");
42  break;
43  case AccLockReq::NoFreeOp:
44  fprintf(output, " returnCode=NoFreeOp");
45  break;
46  default:
47  fprintf(output, " returnCode=%u?", sig->returnCode);
48  break;
49  }
50  switch (reqtype) {
51  case AccLockReq::LockShared:
52  fprintf(output, " req=LockShared\n");
53  break;
54  case AccLockReq::LockExclusive:
55  fprintf(output, " req=LockExclusive\n");
56  break;
57  case AccLockReq::Unlock:
58  fprintf(output, " req=Unlock\n");
59  break;
60  case AccLockReq::Abort:
61  fprintf(output, " req=Abort\n");
62  break;
63  default:
64  fprintf(output, " req=%u\n", reqtype);
65  break;
66  }
67  fprintf(output, " accOpPtr: 0x%x\n", sig->accOpPtr);
68  if (reqtype == AccLockReq::LockShared ||
69  reqtype == AccLockReq::LockExclusive) {
70  fprintf(output, " userPtr: 0x%x userRef: 0x%x\n", sig->userPtr, sig->userRef);
71  fprintf(output, " table: id=%u", sig->tableId);
72  fprintf(output, " fragment: id=%u ptr=0x%x\n", sig->fragId, sig->fragPtrI);
73  fprintf(output, " tuple: addr=%u/%u hashValue=%x\n", sig->page_id, sig->page_idx, sig->hashValue);
74  fprintf(output, " transid: %08x %08x\n", sig->transId1, sig->transId2);
75  }
76  return true;
77 }