MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HugoCalculator.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 NDBT_CALC_HPP
19 #define NDBT_CALC_HPP
20 
21 #include <NDBT_ResultRow.hpp>
22 
23 /* *************************************************************
24  * HugoCalculator
25  *
26  * Comon class for the Hugo test suite, provides the functions
27  * that is used for calculating values to load in to table and
28  * also knows how to verify a row that's been read from db
29  *
30  * ************************************************************/
32 public:
34  Int32 calcValue(int record, int attrib, int updates) const;
35  const char* calcValue(int record, int attrib, int updates, char* buf,
36  int len, Uint32* real_len) const;
37 
38  int verifyRowValues(NDBT_ResultRow* const pRow) const;
39  int verifyRecAttr(int record, int updates, const NdbRecAttr* recAttr);
40  int verifyColValue(int record, int attrib, int updates,
41  const char* valPtr, Uint32 valLen);
42  int getIdValue(NDBT_ResultRow* const pRow) const;
43  int getUpdatesValue(NDBT_ResultRow* const pRow) const;
44  int isIdCol(int colId) { return m_idCol == colId; };
45  int isUpdateCol(int colId){ return m_updatesCol == colId; };
46 
47  const NdbDictionary::Table& getTable() const { return m_tab;}
48 
49  int equalForRow(Uint8 *, const NdbRecord*, int rowid);
50  int setValues(Uint8*, const NdbRecord*, int rowid, int updateval);
51 private:
52  const NdbDictionary::Table& m_tab;
53  int m_idCol;
54  int m_updatesCol;
55 };
56 
57 
58 #endif
59 
60 
61 
62