~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump_data.h

Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#define DRIZZLE_MAX_LINE_LENGTH 1024*1024L-1025
24
24
#include "client_priv.h"
 
25
#include "server_detect.h"
25
26
#include <string>
26
27
#include <iostream>
27
28
#include <iomanip>
75
76
    bool isPrimary;
76
77
    bool isUnique;
77
78
    bool isHash;
78
 
    uint32_t length;
79
79
 
80
 
    std::vector<std::string> columns;
 
80
    /* Stores the column name and the length of the index part */
 
81
    typedef std::pair<std::string,uint32_t> columnData;
 
82
    std::vector<columnData> columns;
81
83
    friend std::ostream& operator <<(std::ostream &os, const DrizzleDumpIndex &obj);
82
84
};
83
85
 
132
134
    DrizzleDumpTable(std::string &table, DrizzleDumpConnection* connection) :
133
135
      dcon(connection),
134
136
      tableName(table),
 
137
      replicate(true),
135
138
      database(NULL)
136
139
    { }
137
140
 
154
157
    std::string engineName;
155
158
    std::string collate;
156
159
    std::string comment;
 
160
    bool replicate;
157
161
 
158
162
    // Currently MySQL only, hard to do in Drizzle
159
163
    uint64_t autoIncrement;
214
218
    drizzle_con_st connection;
215
219
    std::string hostName;
216
220
    bool drizzleProtocol;
217
 
    int serverType;
 
221
    ServerDetect::server_type serverType;
 
222
    std::string serverVersion;
218
223
 
219
224
  public:
220
 
    enum server_type {
221
 
      SERVER_MYSQL_FOUND,
222
 
      SERVER_DRIZZLE_FOUND,
223
 
      SERVER_UNKNOWN_FOUND
224
 
    };
225
225
    DrizzleDumpConnection(std::string &host, uint16_t port,
226
226
      std::string &username, std::string &password, bool drizzle_protocol);
227
227
    ~DrizzleDumpConnection();
244
244
    bool setDB(std::string databaseName);
245
245
    bool usingDrizzleProtocol(void) const { return drizzleProtocol; }
246
246
    bool getServerType(void) const { return serverType; }
247
 
    const char* getServerVersion(void) { return drizzle_con_server_version(&connection); }
 
247
    std::string getServerVersion(void) const { return serverVersion; }
248
248
};
249
249
 
250
250
class DrizzleStringBuf : public std::streambuf