MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NdbSchemaCon.hpp
1 /*
2  Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef NdbSchemaCon_H
19 #define NdbSchemaCon_H
20 
21 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
22 
23 #include <ndb_types.h>
24 #include "NdbError.hpp"
25 #include <NdbSchemaOp.hpp>
26 
27 class NdbSchemaOp;
28 class Ndb;
29 class NdbApiSignal;
30 
52 {
53 friend class Ndb;
54 friend class NdbSchemaOp;
55 
56 public:
57 
58  static
59  NdbSchemaCon* startSchemaTrans(Ndb* pNdb){
60  return new NdbSchemaCon(pNdb);
61  }
62 
63  static
64  void closeSchemaTrans(NdbSchemaCon* pSchCon){
65  delete pSchCon;
66  }
67 
68 
74  int execute();
75 
84 
90  const NdbError & getNdbError() const;
91 
92 private:
93 
94 /******************************************************************************
95  * These are the create and delete methods of this class.
96  *****************************************************************************/
97 
98  NdbSchemaCon(Ndb* aNdb);
99  ~NdbSchemaCon();
100 
101 /******************************************************************************
102  * These are the private methods of this class.
103  *****************************************************************************/
104 
105  void release(); // Release all schemaop in schemaCon
106 
107  /***************************************************************************
108  * These methods are service methods to other classes in the NDBAPI.
109  ***************************************************************************/
110 
111  int checkMagicNumber(); // Verify correct object
112  int receiveDICTTABCONF(NdbApiSignal* aSignal);
113  int receiveDICTTABREF(NdbApiSignal* aSignal);
114 
115 
116  int receiveCREATE_INDX_CONF(NdbApiSignal*);
117  int receiveCREATE_INDX_REF(NdbApiSignal*);
118  int receiveDROP_INDX_CONF(NdbApiSignal*);
119  int receiveDROP_INDX_REF(NdbApiSignal*);
120 
121 
122 /*****************************************************************************
123  * These are the private variables of this class.
124  *****************************************************************************/
125 
126 
127  NdbError theError; // Errorcode
128  Ndb* theNdb; // Pointer to Ndb object
129 
130  NdbSchemaOp* theFirstSchemaOpInList; // First operation in operation list.
131  int theMagicNumber; // Magic number
132 };
133 
134 inline
135 int
136 NdbSchemaCon::checkMagicNumber()
137 {
138  if (theMagicNumber != 0x75318642)
139  return -1;
140  return 0;
141 }//NdbSchemaCon::checkMagicNumber()
142 
143 
144 
145 #endif
146 #endif
147 
148