MCPcopy Create free account
hub / github.com/DeNA/HandlerSocket-Plugin-for-MySQL / auto_mysql

Class auto_mysql

client/hslongrun.cpp:28–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace dena {
27
28struct auto_mysql : private noncopyable {
29 auto_mysql() : db(0) {
30 reset();
31 }
32 ~auto_mysql() {
33 if (db) {
34 mysql_close(db);
35 }
36 }
37 void reset() {
38 if (db) {
39 mysql_close(db);
40 }
41 if ((db = mysql_init(0)) == 0) {
42 fatal_exit("failed to initialize mysql client");
43 }
44 }
45 operator MYSQL *() const { return db; }
46 private:
47 MYSQL *db;
48};
49
50struct auto_mysql_res : private noncopyable {
51 auto_mysql_res(MYSQL *db) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected