MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NDBT_Table.cpp
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 #include <NDBT_Table.hpp>
20 #include <NdbTimer.hpp>
21 #include <NDBT.hpp>
22 
23 class NdbOut&
24 operator <<(class NdbOut& ndbout, const NDBT_Table & tab)
25 {
26  ndbout << "-- " << tab.getName() << " --" << endl;
27 
28  ndbout << "Version: " << tab.getObjectVersion() << endl;
29  ndbout << "Fragment type: " << (unsigned) tab.getFragmentType() << endl;
30  ndbout << "K Value: " << tab.getKValue()<< endl;
31  ndbout << "Min load factor: " << tab.getMinLoadFactor()<< endl;
32  ndbout << "Max load factor: " << tab.getMaxLoadFactor()<< endl;
33  ndbout << "Temporary table: " << (tab.getStoredTable() ? "no" : "yes") << endl;
34  ndbout << "Number of attributes: " << tab.getNoOfColumns() << endl;
35  ndbout << "Number of primary keys: " << tab.getNoOfPrimaryKeys() << endl;
36  ndbout << "Length of frm data: " << tab.getFrmLength() << endl;
37  ndbout << "Row Checksum: " << tab.getRowChecksumIndicator() << endl;
38  ndbout << "Row GCI: " << tab.getRowGCIIndicator() << endl;
39  ndbout << "SingleUserMode: " << (Uint32) tab.getSingleUserMode() << endl;
40  ndbout << "ForceVarPart: " << tab.getForceVarPart() << endl;
41  ndbout << "FragmentCount: " << tab.getFragmentCount() << endl;
42  ndbout << "ExtraRowGciBits: " << tab.getExtraRowGciBits() << endl;
43  ndbout << "ExtraRowAuthorBits: " << tab.getExtraRowAuthorBits() << endl;
44 
45  //<< ((tab.getTupleKey() == TupleId) ? " tupleid" : "") <<endl;
46  ndbout << "TableStatus: ";
47  switch(tab.getObjectStatus()){
49  ndbout << "New" << endl;
50  break;
52  ndbout << "Changed" << endl;
53  break;
55  ndbout << "Retrieved" << endl;
56  break;
57  default:
58  ndbout << "Unknown(" << (unsigned) tab.getObjectStatus() << ")" << endl;
59  }
60 
61  ndbout << "-- Attributes -- " << endl;
62  int noOfAttributes = tab.getNoOfColumns();
63  for(int i = 0; i<noOfAttributes; i++){
64  ndbout << (* (const NDBT_Attribute*)tab.getColumn(i)) << endl;
65  }
66 
67  return ndbout;
68 }
69 
70 class NdbOut& operator <<(class NdbOut&, const NdbDictionary::Index & idx)
71 {
72  ndbout << idx.getName();
73  ndbout << "(";
74  for (unsigned i=0; i < idx.getNoOfColumns(); i++)
75  {
76  const NdbDictionary::Column *col = idx.getColumn(i);
77  ndbout << col->getName();
78  if (i < idx.getNoOfColumns()-1)
79  ndbout << ", ";
80  }
81  ndbout << ")";
82 
83  ndbout << " - ";
84  switch (idx.getType()) {
86  ndbout << "UniqueHashIndex";
87  break;
89  ndbout << "OrderedIndex";
90  break;
91  default:
92  ndbout << "Type " << (unsigned) idx.getType();
93  break;
94  }
95  return ndbout;
96 }
97