~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump_data.h

  • Committer: Monty Taylor
  • Date: 2010-11-08 18:26:08 UTC
  • mto: This revision was merged to the branch mainline in revision 1931.
  • Revision ID: mordred@inaugust.com-20101108182608-lci86acl7r53sbi3
Replaced auto_ptr with scoped_ptr.

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"
26
25
#include <string>
27
26
#include <iostream>
28
27
#include <iomanip>
92
91
      isUnsigned(false),
93
92
      isAutoIncrement(false),
94
93
      defaultIsNull(false),
95
 
      convertDateTime(false),
96
 
      rangeCheck(false)
 
94
      convertDateTime(false)
97
95
    { }
98
96
 
99
97
    virtual ~DrizzleDumpField() { }
111
109
    bool isAutoIncrement;
112
110
    bool defaultIsNull;
113
111
    bool convertDateTime;
114
 
    bool rangeCheck;
115
112
    std::string defaultValue;
116
113
    std::string collation;
117
 
    std::string comment;
118
114
 
119
115
    /* For enum type */
120
116
    std::string enumValues;
215
211
    drizzle_con_st connection;
216
212
    std::string hostName;
217
213
    bool drizzleProtocol;
218
 
    ServerDetect::server_type serverType;
219
 
    std::string serverVersion;
 
214
    int serverType;
220
215
 
221
216
  public:
 
217
    enum server_type {
 
218
      SERVER_MYSQL_FOUND,
 
219
      SERVER_DRIZZLE_FOUND,
 
220
      SERVER_UNKNOWN_FOUND
 
221
    };
222
222
    DrizzleDumpConnection(std::string &host, uint16_t port,
223
223
      std::string &username, std::string &password, bool drizzle_protocol);
224
224
    ~DrizzleDumpConnection();
241
241
    bool setDB(std::string databaseName);
242
242
    bool usingDrizzleProtocol(void) const { return drizzleProtocol; }
243
243
    bool getServerType(void) const { return serverType; }
244
 
    std::string getServerVersion(void) const { return serverVersion; }
 
244
    const char* getServerVersion(void) { return drizzle_con_server_version(&connection); }
245
245
};
246
246
 
247
247
class DrizzleStringBuf : public std::streambuf
262
262
    void writeString(std::string &str)
263
263
    {
264
264
      if (not connection->queryNoResult(str))
265
 
        throw std::exception();
 
265
        throw 1;
266
266
    }
267
267
 
268
268
    void setConnection(DrizzleDumpConnection *conn) { connection= conn; }