Merge pull request #3856 from sysown/v2.x-rm_duplicate_mysql_err_counts

Fix duplicate counting of MySQL errors for client conns
pull/3801/merge
René Cannaò 4 years ago committed by GitHub
commit 8d2a88a746
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6743,7 +6743,6 @@ void MySQL_Session::MySQL_Stmt_Result_to_MySQL_wire(MYSQL_STMT *stmt, MySQL_Conn
MYSQL *mysql=stmt->mysql;
// no result set
int myerrno=mysql_stmt_errno(stmt);
MyHGM->p_update_mysql_error_counter(p_mysql_error_type::mysql, myconn->parent->myhgc->hid, myconn->parent->address, myconn->parent->port, myerrno);
if (myerrno==0) {
unsigned int num_rows = mysql_affected_rows(stmt->mysql);
unsigned int nTrx=NumActiveTransactions();
@ -6826,11 +6825,6 @@ void MySQL_Session::MySQL_Result_to_MySQL_wire(MYSQL *mysql, MySQL_ResultSet *My
//client_myds->pkt_sid++;
} else {
// error
if (_myds) {
if (_myds->myconn) {
MyHGM->p_update_mysql_error_counter(p_mysql_error_type::mysql, _myds->myconn->parent->myhgc->hid, _myds->myconn->parent->address, _myds->myconn->parent->port, myerrno);
}
}
char sqlstate[10];
sprintf(sqlstate,"%s",mysql_sqlstate(mysql));
if (_myds && _myds->killed_at) { // see case #750

@ -274,7 +274,6 @@ void MySQL_Connection::compute_unknown_transaction_status() {
unknown_transaction_status = false; // no error
return;
}
MyHGM->p_update_mysql_error_counter(p_mysql_error_type::mysql, parent->myhgc->hid, parent->address, parent->port, _myerrno);
if (_myerrno >= 2000 && _myerrno < 3000) { // client error
// do not change it
return;

Loading…
Cancel
Save