| 90 | } |
| 91 | |
| 92 | int 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 | |
| 109 | int MySQLCommand::GetValue(const string &value_type, const string &value_key, string *value) { |
| 110 | char cmd[128]; |
nothing calls this directly
no test coverage detected