MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GetTabInfo.cpp
1 /* Copyright (C) 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
15 
16 #include <signaldata/GetTabInfo.hpp>
17 #include <signaldata/DictTabInfo.hpp>
18 
19 bool
20 printGET_TABINFO_REQ(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
21 {
22  const GetTabInfoReq* sig = (const GetTabInfoReq*)theData;
23  fprintf(output, " senderRef: 0x%x", sig->senderRef);
24  fprintf(output, " senderData: %u", sig->senderData);
25  fprintf(output, "\n");
26  fprintf(output, " requestType: 0x%x", sig->requestType);
27  bool requestById = !(sig->requestType & GetTabInfoReq::RequestByName);
28  bool requestByName = (sig->requestType & GetTabInfoReq::RequestByName);
29  bool longSignalConf = (sig->requestType & GetTabInfoReq::LongSignalConf);
30  if (requestById)
31  fprintf(output, " RequestById");
32  if (requestByName)
33  fprintf(output, " RequestByName");
34  if (longSignalConf)
35  fprintf(output, " LongSignalConf");
36  fprintf(output, "\n");
37  if (requestById)
38  fprintf(output, " tableId: %u", sig->tableId);
39  if (requestByName)
40  fprintf(output, " tableNameLen: %u", sig->tableNameLen);
41  fprintf(output, " schemaTransId: 0x%x", sig->schemaTransId);
42  fprintf(output, "\n");
43  return true;
44 }
45 
46 bool
47 printGET_TABINFO_CONF(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
48 {
49  const GetTabInfoConf* sig = (const GetTabInfoConf*)theData;
50  fprintf(output, " senderRef: 0x%x", sig->senderRef);
51  fprintf(output, " senderData: %u", sig->senderData);
52  fprintf(output, "\n");
53  fprintf(output, " tableId: %u", sig->tableId);
54  fprintf(output, " tableType: %u", sig->tableType);
55  fprintf(output, "\n");
56  switch (sig->tableType) {
58  fprintf(output, " freeExtents: %u", sig->freeExtents);
59  break;
61  fprintf(output, " freeWordsHi: %u", sig->freeWordsHi);
62  fprintf(output, " freeWordsLo: %u", sig->freeWordsLo);
63  break;
66  fprintf(output, " freeExtents: %u", sig->freeExtents);
67  break;
68  default:
69  fprintf(output, " gci: %u", sig->gci);
70  fprintf(output, " totalLen: %u", sig->totalLen);
71  break;
72  }
73  fprintf(output, "\n");
74  return true;
75 }
76 
77 bool
78 printGET_TABINFO_REF(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
79 {
80  const GetTabInfoRef* sig = (const GetTabInfoRef*)theData;
81  fprintf(output, " senderRef: 0x%x", sig->senderRef);
82  fprintf(output, " senderData: %u", sig->senderData);
83  fprintf(output, "\n");
84  fprintf(output, " requestType: 0x%x", sig->requestType);
85  bool requestById = !(sig->requestType & GetTabInfoReq::RequestByName);
86  bool requestByName = (sig->requestType & GetTabInfoReq::RequestByName);
87  bool longSignalConf = (sig->requestType & GetTabInfoReq::LongSignalConf);
88  if (requestById)
89  fprintf(output, " RequestById");
90  if (requestByName)
91  fprintf(output, " RequestByName");
92  if (longSignalConf)
93  fprintf(output, " LongSignalConf");
94  fprintf(output, "\n");
95  if (requestById)
96  fprintf(output, " tableId: %u", sig->tableId);
97  if (requestByName)
98  fprintf(output, " tableNameLen: %u", sig->tableNameLen);
99  fprintf(output, " schemaTransId: 0x%x", sig->schemaTransId);
100  fprintf(output, " errorCode: %u", sig->errorCode);
101  fprintf(output, " errorLine: %u", sig->errorLine);
102  fprintf(output, "\n");
103  return true;
104 }