~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump_data.h

  • Committer: Mark Atwood
  • Date: 2011-08-11 03:05:03 UTC
  • mfrom: (2385.1.12 refactor4)
  • Revision ID: me@mark.atwood.name-20110811030503-rp9xjihc5x3y0x4q
mergeĀ lp:~olafvdspek/drizzle/refactor4

Show diffs side-by-side

added added

removed removed

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