MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UtilPrepare.cpp
1 /*
2  Copyright (C) 2003, 2005-2007 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/UtilPrepare.hpp>
20 
21 bool
22 printUTIL_PREPARE_REQ(FILE* out, const Uint32 * data, Uint32 len, Uint16 rec)
23 {
24  UtilPrepareReq* sig = (UtilPrepareReq*)data;
25  fprintf(out, " senderRef: H'%.8x senderData: H'%.8x schemaTransId: H'%.8x\n",
26  sig->senderRef,
27  sig->senderData,
28  sig->schemaTransId);
29 
30  return true;
31 }
32 
33 bool
34 printUTIL_PREPARE_CONF(FILE* out, const Uint32 * data, Uint32 len, Uint16 rec)
35 {
36  UtilPrepareConf* sig = (UtilPrepareConf*)data;
37  fprintf(out, " senderData: H'%.8x prepareId: %d\n",
38  sig->senderData,
39  sig->prepareId);
40  return true;
41 }
42 
43 bool
44 printUTIL_PREPARE_REF(FILE* out, const Uint32 * data, Uint32 len, Uint16 rec)
45 {
46  UtilPrepareRef* sig = (UtilPrepareRef*)data;
47  fprintf(out, " senderData: H'%.8x, ", sig->senderData);
48  fprintf(out, " error: %d, ", sig->errorCode);
49 
50  fprintf(out, " errorMsg: ");
51  switch(sig->errorCode) {
52  case UtilPrepareRef::NO_ERROR:
53  fprintf(out, "No error");
54  break;
55  case UtilPrepareRef::PREPARE_SEIZE_ERROR:
56  fprintf(out, "Failed to seize Prepare record");
57  break;
58  case UtilPrepareRef::PREPARED_OPERATION_SEIZE_ERROR:
59  fprintf(out, "Failed to seize PreparedOperation record");
60  break;
61  case UtilPrepareRef::DICT_TAB_INFO_ERROR:
62  fprintf(out, "Failed to get table info from DICT");
63  break;
64  }
65  fprintf(out, "\n");
66  return true;
67 }