forked from anse1/sqlsmith
-
Notifications
You must be signed in to change notification settings - Fork 8
/
mysql.hh
48 lines (38 loc) · 981 Bytes
/
mysql.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/// @file
/// @brief schema and dut classes for MySQL
/// @company www.greatopensource.com
#ifndef MYSQL_HH
#define MYSQL_HH
extern "C" {
#include <mysql/mysql.h>
}
#include <sstream>
#include <string>
#include "schema.hh"
#include "relmodel.hh"
#include "dut.hh"
#include "log.hh"
struct mysql_connection {
MYSQL mysql;
mysql_connection(std::string &conninfo);
~mysql_connection();
void parse_connection_string(std::string &conninfo);
std::string host = "127.0.0.1";
int port = 3306;
std::string db = "test";
std::string user = "root";
std::string password = "";
};
struct schema_mysql : schema, mysql_connection {
schema_mysql(std::string &conninfo, bool no_catalog);
virtual std::string quote_name(const std::string &id) {
std::stringstream ss;
ss << "`" << id << "`";
return ss.str();
}
};
struct dut_mysql : dut_base, mysql_connection {
virtual void test(const std::string &stmt);
dut_mysql(std::string &conninfo);
};
#endif