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

« back to all changes in this revision

Viewing changes to storage/ndb/include/kernel/signaldata/CreateTable.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 CREATE_TABLE_HPP
 
17
#define CREATE_TABLE_HPP
 
18
 
 
19
#include "SignalData.hpp"
 
20
 
 
21
/**
 
22
 * CreateTable
 
23
 *
 
24
 * This signal is sent by API to DICT/TRIX
 
25
 * as a request to create a secondary index
 
26
 * and then from TRIX to TRIX(n) and TRIX to TC.
 
27
 */
 
28
class CreateTableReq {
 
29
  /**
 
30
   * Sender(s)
 
31
   */
 
32
  // API
 
33
  
 
34
  /**
 
35
   * Sender(s) / Reciver(s)
 
36
   */
 
37
  friend class NdbDictInterface;
 
38
  friend class Dbdict;
 
39
  friend class Ndbcntr;
 
40
 
 
41
  /**
 
42
   * For printing
 
43
   */
 
44
  friend bool printCREATE_TABLE_REQ(FILE*, const Uint32*, Uint32, Uint16);
 
45
  
 
46
public:
 
47
  STATIC_CONST( SignalLength = 2 );
 
48
  
 
49
private:
 
50
  Uint32 senderData;
 
51
  Uint32 senderRef;
 
52
 
 
53
  SECTION( DICT_TAB_INFO = 0 );
 
54
};
 
55
 
 
56
class CreateTableRef {
 
57
  /**
 
58
   * Sender(s)
 
59
   */
 
60
  friend class Dbdict;
 
61
  
 
62
  /**
 
63
   * Sender(s) / Reciver(s)
 
64
   */
 
65
  friend class Ndbcntr;
 
66
  friend class NdbDictInterface;
 
67
  
 
68
  /**
 
69
   * For printing
 
70
   */
 
71
  friend bool printCREATE_TABLE_REF(FILE *, const Uint32 *, Uint32, Uint16);
 
72
  
 
73
public:
 
74
  STATIC_CONST( SignalLength = 7 );
 
75
 
 
76
  enum ErrorCode {
 
77
    NoError = 0,
 
78
    Busy = 701,
 
79
    BusyWithNR = 711,
 
80
    NotMaster = 702,
 
81
    InvalidFormat = 703,
 
82
    AttributeNameTooLong = 704,
 
83
    TableNameTooLong = 705,
 
84
    Inconsistency = 706,
 
85
    NoMoreTableRecords = 707,
 
86
    NoMoreAttributeRecords = 708,
 
87
    AttributeNameTwice = 720,
 
88
    TableAlreadyExist = 721,
 
89
    InvalidArraySize = 736,
 
90
    ArraySizeTooBig = 737,
 
91
    RecordTooBig = 738,
 
92
    InvalidPrimaryKeySize  = 739,
 
93
    NullablePrimaryKey = 740,
 
94
    InvalidCharset = 743,
 
95
    SingleUser = 299,
 
96
    InvalidTablespace = 755,
 
97
    VarsizeBitfieldNotSupported = 757,
 
98
    NotATablespace = 758,
 
99
    InvalidTablespaceVersion = 759,
 
100
    OutOfStringBuffer = 773,
 
101
    NoLoggingTemporaryTable = 778
 
102
  };
 
103
 
 
104
private:
 
105
  Uint32 senderData;
 
106
  Uint32 senderRef;
 
107
  Uint32 masterNodeId;
 
108
  Uint32 errorCode;
 
109
  Uint32 errorLine; 
 
110
  Uint32 errorKey;
 
111
  Uint32 status;
 
112
 
 
113
public:
 
114
  Uint32 getErrorCode() const {
 
115
    return errorCode;
 
116
  }
 
117
  Uint32 getErrorLine() const {
 
118
    return errorLine;
 
119
  }
 
120
};
 
121
 
 
122
class CreateTableConf {
 
123
  /**
 
124
   * Sender(s)
 
125
   */
 
126
  friend class Dbdict;
 
127
  
 
128
  /**
 
129
   * Sender(s) / Reciver(s)
 
130
   */
 
131
  friend class Ndbcntr;
 
132
  friend class NdbDictInterface;
 
133
  
 
134
  /**
 
135
   * For printing
 
136
   */
 
137
  friend bool printCREATE_TABLE_REF(FILE *, const Uint32 *, Uint32, Uint16);
 
138
  
 
139
public:
 
140
  STATIC_CONST( SignalLength = 4 );
 
141
 
 
142
private:
 
143
  Uint32 senderData;
 
144
  Uint32 senderRef;
 
145
  Uint32 tableId;
 
146
  Uint32 tableVersion;
 
147
};
 
148
 
 
149
#endif