~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/ndb/include/kernel/signaldata/UtilDelete.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#ifndef UTIL_DELETE_HPP
 
17
#define UTIL_DELETE_HPP
 
18
 
 
19
#include "SignalData.hpp"
 
20
#include <SimpleProperties.hpp>
 
21
 
 
22
/**
 
23
 * UTIL_DELETE_REQ, UTIL_DELETE_CONF, UTIL_DELETE_REF
 
24
 */
 
25
 
 
26
/**
 
27
 * @class UtilDeleteReq
 
28
 * @brief Delete transaction in Util block
 
29
 *
 
30
 * Data format:
 
31
 * - UTIL_DELETE_REQ <prepareId> <ListOfAttributeHeaderValuePairs>
 
32
 */
 
33
 
 
34
class UtilDeleteReq {
 
35
  /** Sender(s) / Receiver(s) */
 
36
  friend class DbUtil;
 
37
 
 
38
  /** For printing */
 
39
  friend bool printUTIL_DELETE_REQ(FILE * output, const Uint32 * theData, 
 
40
                                   Uint32 len, Uint16 receiverBlockNo);
 
41
public:
 
42
  STATIC_CONST( DataLength = 22 );
 
43
  STATIC_CONST( HeaderLength = 3 );
 
44
 
 
45
private:  
 
46
  Uint32 senderData;
 
47
  Uint32 prepareId;     // Which prepared transaction to execute
 
48
  Uint32 totalDataLen;  // Total length of attrData (including AttributeHeaders
 
49
                        // and possibly spanning over multiple signals)
 
50
 
 
51
  /**
 
52
   * Length in this = signal->length() - 3
 
53
   * Sender block ref = signal->senderBlockRef()
 
54
   */
 
55
  
 
56
  Uint32 attrData[DataLength];
 
57
};
 
58
 
 
59
 
 
60
 
 
61
/**
 
62
 * @class UtilDeleteConf
 
63
 *
 
64
 * Data format:
 
65
 * - UTIL_PREPARE_CONF <UtilPrepareId> 
 
66
 */
 
67
 
 
68
class UtilDeleteConf {
 
69
  /**
 
70
   * Sender(s) / Receiver(s)
 
71
   */
 
72
  friend class DbUtil;
 
73
 
 
74
  /**
 
75
   * For printing
 
76
   */
 
77
  friend bool printUTIL_DELETE_CONF(FILE * output, 
 
78
                                     const Uint32 * theData, 
 
79
                                     Uint32 len, 
 
80
                                     Uint16 receiverBlockNo);
 
81
 
 
82
  STATIC_CONST( SignalLength = 1 );
 
83
 
 
84
private:
 
85
  Uint32 senderData;   ///< The client data provided by the client sending
 
86
                       ///< UTIL_DELETE_REQ
 
87
};
 
88
 
 
89
 
 
90
/**
 
91
 * @class UtilDeleteRef
 
92
 *
 
93
 * Data format:
 
94
 * - UTIL_PREPARE_REF 
 
95
 */
 
96
 
 
97
class UtilDeleteRef {
 
98
  /**
 
99
   * Sender(s) / Receiver(s)
 
100
   */
 
101
  friend class DbUtil;
 
102
 
 
103
  /**
 
104
   * For printing
 
105
   */
 
106
  friend bool printUTIL_DELETE_REF(FILE * output, 
 
107
                                    const Uint32 * theData, 
 
108
                                    Uint32 len, 
 
109
                                    Uint16 receiverBlockNo);
 
110
 
 
111
  STATIC_CONST( SignalLength = 2 );
 
112
 
 
113
private:
 
114
  Uint32 senderData;
 
115
  Uint32 errorCode;   ///< See UtilExecuteRef::errorCode
 
116
  Uint32 TCErrorCode;
 
117
};
 
118
 
 
119
 
 
120
#endif