MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AttrInfo.hpp
1 /*
2  Copyright (C) 2003-2008 MySQL AB
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 ATTRINFO_HPP
20 #define ATTRINFO_HPP
21 
22 #include "SignalData.hpp"
23 
24 class AttrInfo {
28  friend class DbUtil;
29 
33  friend class Dbtup;
34 
38  friend class Dbtc;
39  friend class Dblqh;
40  friend class NdbScanOperation;
41  friend class Restore;
42  friend class NdbOperation;
43 
44  friend bool printATTRINFO(FILE *, const Uint32 *, Uint32, Uint16);
45 
46 public:
47  STATIC_CONST( HeaderLength = 3 );
48  STATIC_CONST( DataLength = 22 );
49  STATIC_CONST( MaxSignalLength = HeaderLength + DataLength );
50  STATIC_CONST( SectionSizeInfoLength = 5 );
51 
52 private:
53  Uint32 connectPtr;
54  Uint32 transId[2];
55  Uint32 attrData[DataLength];
56 };
57 
58 /*
59  A train of ATTRINFO signals is used to specify attributes to read or
60  attributes and values to insert/update in TCKEYREQ, and to specify
61  attributes to read in SCAN_TABREQ.
62 
63  The ATTRINFO signal train defines a stream of attribute info words. (Note
64  that for TCKEYREQ, the first five words are stored inside the TCKEYREQ
65  signal. For SCAN_TABREQ, all attribute info words are sent in ATTRINFO
66  signals).
67 
68  For SCAN_TABREQ, and TCKEYREQ for read or update with interpreted code,
69  the attribute information can have up to five sections. The initial
70  five words of the stream defines the length of the sections, followed
71  by the words of each section in sequence.
72 
73  The sections are:
74  1. Attributes to read before starting any interpreted program.
75  2. Interpreted program.
76  3. Attributes to update after running interpreted program.
77  4. Attributes to read after interpreted program.
78  5. Subroutine data.
79 
80  The formats of sections that specify attributes to read or update is a
81  sequence of entries, each (1+N) words:
82  1 word specifying the AttributeHeader (attribute id in upper 16 bits, and
83  size in bytes of data in lower 16 bits).
84  N words of data (N = (data byte length+3)>>2).
85  For specifying attributes to read, the data length is always zero.
86  For an index range scan of a table using an ordered index, the attribute IDs
87  refer to columns in the underlying table, not to columns being indexed, so
88  all attributes in the underlying table being indexed are accessible.
89 */
90 
91 #endif