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

« back to all changes in this revision

Viewing changes to storage/ndb/include/kernel/signaldata/GetTabInfo.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 GET_INFO_TAB_HPP
 
17
#define GET_INFO_TAB_HPP
 
18
 
 
19
#include "SignalData.hpp"
 
20
 
 
21
/**
 
22
 * GetTabInfo - Get table info from DICT
 
23
 *
 
24
 * Successfull return = series of DICTTABINFO-signals
 
25
 */
 
26
class GetTabInfoReq {
 
27
  /**
 
28
   * Sender(s) / Reciver(s)
 
29
   */
 
30
  // Blocks
 
31
  friend class Dbdict;
 
32
  friend class Backup;
 
33
  friend class Trix;
 
34
  friend class DbUtil;
 
35
  // API
 
36
  friend class Table;
 
37
 
 
38
  friend bool printGET_TABINFO_REQ(FILE *, const Uint32 *, Uint32, Uint16);  
 
39
public:
 
40
  STATIC_CONST( SignalLength = 5 );
 
41
public:
 
42
  Uint32 senderData;
 
43
  Uint32 senderRef;
 
44
  Uint32 requestType; // Bitmask of GetTabInfoReq::RequestType
 
45
  union {
 
46
    Uint32 tableId;
 
47
    Uint32 tableNameLen;
 
48
  };
 
49
  Uint32 unused; // This is located here so that Req & Ref have the same format
 
50
 
 
51
  enum RequestType {
 
52
    RequestById = 0,
 
53
    RequestByName = 1,
 
54
    LongSignalConf = 2
 
55
  };
 
56
  SECTION( TABLE_NAME = 0 );
 
57
};
 
58
 
 
59
class GetTabInfoRef {
 
60
  /**
 
61
   * Sender(s) / Reciver(s)
 
62
   */
 
63
  // Blocks
 
64
  friend class Dbdict;
 
65
  friend class Backup;
 
66
  friend class Trix;
 
67
  friend class DbUtil;
 
68
  // API
 
69
  friend class Table;
 
70
 
 
71
  friend bool printGET_TABINFO_REF(FILE *, const Uint32 *, Uint32, Uint16);    
 
72
public:
 
73
  STATIC_CONST( SignalLength = 5 );
 
74
public:
 
75
  Uint32 senderData;
 
76
  Uint32 senderRef;
 
77
  Uint32 requestType; // Bitmask of GetTabInfoReq::RequestType
 
78
  union {
 
79
    Uint32 tableId;
 
80
    Uint32 tableNameLen;
 
81
  };
 
82
  Uint32 errorCode;
 
83
 
 
84
  enum ErrorCode {
 
85
    InvalidTableId = 709,
 
86
    TableNotDefined = 723,
 
87
    TableNameTooLong = 702,
 
88
    NoFetchByName = 710,
 
89
    Busy = 701
 
90
  };
 
91
};
 
92
 
 
93
class GetTabInfoConf {
 
94
  /**
 
95
   * Sender(s) / Reciver(s)
 
96
   */
 
97
  // Blocks
 
98
  friend class Dbdict;
 
99
  friend class Backup;
 
100
  friend class Trix;
 
101
  friend class DbUtil;
 
102
  friend class Suma;
 
103
  // API
 
104
  friend class Table;
 
105
 
 
106
  friend bool printGET_TABINFO_CONF(FILE *, const Uint32 *, Uint32, Uint16);  
 
107
public:
 
108
  STATIC_CONST( SignalLength = 6 );
 
109
 
 
110
  SECTION( DICT_TAB_INFO = 0 );
 
111
public:
 
112
  Uint32 senderData;
 
113
  Uint32 tableId;
 
114
  union {
 
115
    Uint32 gci; // For table
 
116
    Uint32 freeWordsHi; // for logfile group m_free_file_words
 
117
  };
 
118
  union {
 
119
    Uint32 totalLen; // In words
 
120
    Uint32 freeExtents;
 
121
    Uint32 freeWordsLo; // for logfile group m_free_file_words
 
122
  };
 
123
  Uint32 tableType;
 
124
  Uint32 senderRef;
 
125
};
 
126
 
 
127
#endif