Skip to content

Commit

Permalink
Update src/mysql_bindings_connection.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-zhao committed Feb 10, 2012
1 parent b74d0e3 commit 8d1c881
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mysql_bindings_connection.cc
Expand Up @@ -1114,11 +1114,12 @@ void MysqlConnection::EIO_Query(eio_req *req) {

pthread_mutex_lock(&conn->query_lock);
int r = mysql_query(conn->_conn, query_req->query);
if (r != 0) {
int errno = mysql_errno(conn->_conn);
if (r != 0 || errno != 0) {
// Query error
req->result = 1;

query_req->errno = mysql_errno(conn->_conn);
query_req->errno = errno;
query_req->error = mysql_error(conn->_conn);
} else {
req->result = 0;
Expand All @@ -1142,6 +1143,8 @@ void MysqlConnection::EIO_Query(eio_req *req) {
} else {
// Result store error
req->result = 1;
query_req->errno = errno;
query_req->error = mysql_error(conn->_conn);
}
}
}
Expand Down

0 comments on commit 8d1c881

Please sign in to comment.