Skip to content

Commit

Permalink
Merge pull request btccom#220 from xhliu/deveth
Browse files Browse the repository at this point in the history
Bug fix: show mysql error before closing connection
  • Loading branch information
de1acr0ix authored Jan 3, 2019
2 parents 8ab4877 + 2dc9b76 commit 2cf1214
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MySQLConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ bool MySQLConnection::open() {
}
if (mysql_real_connect(conn, host_.c_str(), username_.c_str(), password_.c_str(),
dbName_.c_str(), port_, nullptr, 0) == nullptr) {
close();
LOG(ERROR) << "mysql_real_connect failed: " << mysql_error(conn);
close();
return false;
}

Expand Down

0 comments on commit 2cf1214

Please sign in to comment.