1
/* Copyright (C) 2003 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
#ifndef NDBT_DATA_SET_HPP
17
#define NDBT_DATA_SET_HPP
19
#include "NDBT_Table.hpp"
24
class NDBT_DataSetFactory {
26
NDBT_DataSet * createEmpty(const NDBT_Table & table,
27
const char * columns[]);
29
NDBT_DataSet * createRandom(const NDBT_DataSet & table,
30
const char * columns[],
33
NDBT_DataSet * createXXX(int noOfDS, const NDBT_DataSet ** datasets);
37
friend class NDBT_DataSetFactory;
40
* Rows in the data set
42
void setRows(int rows);
43
void addRows(int rows);
45
int getNoOfRows() const;
48
* Columns for a row in the data set
50
int getNoOfColumns() const;
51
int getNoOfPKs() const;
53
const NDBT_Attribute * getColumn(int index);
54
const NDBT_Attribute * getColumn(const char * name);
57
* Data status in dataset
60
bool hasData(int row);
63
* Do all rows in the dataset have a PK
68
* Do all rows in the dataset has data
75
Uint32 getUInt(int row, int index) const;
76
Uint32 getUInt(int row, const char * attribute) const;
78
Int32 getInt(int row, int index) const;
79
Int32 getInt(int row, const char * attribute) const;
81
const char * getString(int row, int index) const;
82
const char * getString(int row, const char * attribute) const;
84
bool getIsNull(int row, int index) const;
85
bool getIsNull(int row, const char * attribute) const;
90
void set(int row, int index, Int32 value);
91
void set(int row, const char * attr, Int32 value);
93
void set(int row, int index, Uint32 value);
94
void set(int row, const char * attr, Uint32 value);
96
void set(int row, int index, const char * value);
97
void set(int row, const char * attr, const char * value);
104
* Is this dataset identical to other dataset
106
* If either of the datasets have "undefined" rows the answer is false
108
bool equal(const NDBT_DataSet & other) const;
111
* Do these dataset have identical PK's
115
* and for each row there is a corresponding row in the other ds
118
bool equalPK(const NDBT_DataSet & other) const;
121
NDBT_Attribute * columns;
127
Uint32 * columnSizes;
132
char * pk(int row, int pkIndex);
133
char * column(int row, int columnIndex);