MCPcopy Create free account
hub / github.com/Tencent/phxsql / DoQuery

Method DoQuery

phxbinlogsvr/core/mysql/mysql_command.cpp:92–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92int MySQLCommand::DoQuery(const string &command) {
93 int ret = mysql_query(mysql_, command.c_str());
94
95 if (OK != ret) {
96 ColorLogWarning("%s[mysql] mysql_query fail %d, %s, command %s", __func__, ret, mysql_error(mysql_),
97 command.c_str());
98 if (ret < 0)
99 ret = MYSQL_FAIL;
100 else
101 ret = MYSQL_NODATA;
102 STATISTICS(MySqlQueryFail());
103 }
104 ColorLogInfo("%s mysql_query %s done %d, %s", __func__, command.c_str(), ret, mysql_error(mysql_));
105
106 return ret;
107}
108
109int MySQLCommand::GetValue(const string &value_type, const string &value_key, string *value) {
110 char cmd[128];

Callers

nothing calls this directly

Calls 2

ColorLogWarningFunction · 0.85
ColorLogInfoFunction · 0.85

Tested by

no test coverage detected