MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AlterTab.hpp
1 /*
2  Copyright (C) 2003, 2005-2008 MySQL AB, 2010 Sun Microsystems, Inc.
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef ALTER_TAB_HPP
20 #define ALTER_TAB_HPP
21 
22 #include "SignalData.hpp"
23 #include "GlobalSignalNumbers.h"
24 
25 struct AlterTabReq {
26  STATIC_CONST( SignalLength = 12 );
27 
28  enum RequestType {
29  AlterTablePrepare = 0, // Prepare alter table
30  AlterTableCommit = 1, // Commit alter table
31  AlterTableRevert = 2, // Prepare failed, revert instead
32  AlterTableComplete = 3,
33  AlterTableWaitScan = 4,
34  AlterTableSumaEnable = 5,
35  AlterTableSumaFilter = 6
36  ,AlterTableReadOnly = 7 // From TUP to LQH before mtoib
37  ,AlterTableReadWrite = 8 // From TUP to LQH after mtoib
38  };
39 
40  Uint32 senderRef;
41  Uint32 senderData;
42  Uint32 requestType;
43  Uint32 tableId;
44  Uint32 tableVersion;
45  Uint32 newTableVersion;
46  Uint32 gci;
47  Uint32 changeMask;
48 
49  /* Only used when sending to TUP. */
50  Uint32 connectPtr;
51  Uint32 noOfNewAttr;
52  Uint32 newNoOfCharsets;
53  union {
54  Uint32 newNoOfKeyAttrs;
55  Uint32 new_map_ptr_i;
56  };
57 
58  SECTION( DICT_TAB_INFO = 0 );
59  SECTION( FRAGMENTATION = 1 );
60  /*
61  When sent to DICT, the first section contains the new table definition.
62  When sent to TUP, the first section contains the new attributes.
63  */
64 };
65 
66 struct AlterTabConf {
67  STATIC_CONST( SignalLength = 3 );
68 
69  Uint32 senderRef;
70  Uint32 senderData;
71 
72  /* Only used when sent from TUP. */
73  Uint32 connectPtr;
74 };
75 
76 struct AlterTabRef {
77  STATIC_CONST( SignalLength = 7 );
78 
79  Uint32 senderRef;
80  Uint32 senderData;
81  Uint32 errorCode;
82  Uint32 errorLine;
83  Uint32 errorKey;
84  Uint32 errorStatus;
85  Uint32 connectPtr;
86 };
87 
88 /*
89  This union can be used to safely refer to a signal data part
90  simultaneously as AlterTab{Req,Ref,Conf} without violating the
91  strict aliasing rule.
92 */
93 union AlterTabAll {
94  AlterTabReq req;
95  AlterTabRef ref;
96  AlterTabConf conf;
97 };
98 
99 #endif