1 /* Copyright (c) 2003, 2005 MySQL AB 2 Use is subject to license terms 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 Street, Fifth Floor, Boston, MA 02110-1301, USA */ 16 17 #ifndef CREATE_TAB_HPP 18 #define CREATE_TAB_HPP 19 20 #include "SignalData.hpp" 21 22 /** 23 * CreateTab 24 * 25 * Implemenatation of CreateTable 26 */ 27 class CreateTabReq { 28 /** 29 * Sender(s) / Reciver(s) 30 */ 31 friend class Dbdict; 32 33 /** 34 * For printing 35 */ 36 friend bool printCREATE_TAB_REQ(FILE*, const Uint32*, Uint32, Uint16); 37 38 public: 39 STATIC_CONST( SignalLength = 8 ); 40 41 enum RequestType { 42 CreateTablePrepare = 0, // Prepare create table 43 CreateTableCommit = 1, // Commit create table 44 CreateTableDrop = 2 // Prepare failed, drop instead 45 }; 46 private: 47 Uint32 senderRef; 48 Uint32 senderData; 49 Uint32 clientRef; 50 Uint32 clientData; 51 52 Uint32 tableId; 53 Uint32 tableVersion; 54 Uint32 gci; 55 Uint32 requestType; 56 57 SECTION( DICT_TAB_INFO = 0 ); 58 SECTION( FRAGMENTATION = 1 ); 59 }; 60 61 struct CreateTabRef { 62 /** 63 * Sender(s) / Reciver(s) 64 */ 65 friend class Dbdict; 66 friend class SafeCounter; 67 68 /** 69 * For printing 70 */ 71 friend bool printCREATE_TAB_REF(FILE *, const Uint32 *, Uint32, Uint16); 72 73 STATIC_CONST( SignalLength = 6 ); 74 STATIC_CONST( GSN = GSN_CREATE_TAB_REF ); 75 76 enum ErrorCode { 77 NF_FakeErrorREF = 255 78 }; 79 80 81 Uint32 senderRef; 82 Uint32 senderData; 83 Uint32 errorCode; 84 Uint32 errorLine; 85 Uint32 errorKey; 86 Uint32 errorStatus; 87 }; 88 89 class CreateTabConf { 90 /** 91 * Sender(s) / Reciver(s) 92 */ 93 friend class Dbdict; 94 friend class Suma; 95 96 /** 97 * For printing 98 */ 99 friend bool printCREATE_TAB_CONF(FILE *, const Uint32 *, Uint32, Uint16); 100 101 public: 102 STATIC_CONST( SignalLength = 2 ); 103 104 private: 105 Uint32 senderRef; 106 Uint32 senderData; 107 }; 108 109 #endif 110