1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2010 Andrew Hutchings
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef CLIENT_DRIZZLEDUMP_MYSQL_H
21
#define CLIENT_DRIZZLEDUMP_MYSQL_H
23
#include "drizzledump_data.h"
25
class DrizzleDumpDatabaseMySQL;
26
class DrizzleDumpDataMySQL;
28
class DrizzleDumpIndexMySQL : public DrizzleDumpIndex
31
DrizzleDumpIndexMySQL(std::string &index) : DrizzleDumpIndex(index)
34
~DrizzleDumpIndexMySQL()
41
class DrizzleDumpFieldMySQL : public DrizzleDumpField
44
DrizzleDumpFieldMySQL(std::string &field) : DrizzleDumpField(field)
47
~DrizzleDumpFieldMySQL() { }
49
void dateTimeConvert(const char* oldDefault);
50
void setCollate(const char* newCollate);
51
void setType(const char* raw_type, const char* collation);
54
class DrizzleDumpTableMySQL : public DrizzleDumpTable
57
DrizzleDumpTableMySQL(std::string &table) : DrizzleDumpTable(table)
60
~DrizzleDumpTableMySQL()
66
bool populateFields();
67
bool populateIndexes();
68
void setEngine(const char* newEngine);
69
void setCollate(const char* newCollate);
70
DrizzleDumpData* getData(void);
73
class DrizzleDumpDatabaseMySQL : public DrizzleDumpDatabase
76
DrizzleDumpDatabaseMySQL(const std::string &database) : DrizzleDumpDatabase(database)
78
~DrizzleDumpDatabaseMySQL()
82
bool populateTables();
83
void setCollate(const char* newCollate);
86
class DrizzleDumpDataMySQL : public DrizzleDumpData
89
DrizzleDumpDataMySQL(DrizzleDumpTable *dataTable);
90
~DrizzleDumpDataMySQL();
92
/* For 0000-00-00 -> NULL conversion */
93
std::string convertDate(const char* oldDate) const;
94
/* For xx:xx:xx -> INT conversion */
95
long convertTime(const char* oldTime) const;
96
std::ostream& checkDateTime(std::ostream &os, const char* item, uint32_t field) const;
99
#endif /* CLIENT_DRIZZLEDUMP_MYSQL_H */