Bug #110171 net_set_retry_count value set
Submitted: 22 Feb 2023 14:58 Modified: 22 Feb 2023 16:33
Reporter: bin wang (OCA) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:Ver 8.0 OS:Any
Assigned to: CPU Architecture:Any

[22 Feb 2023 14:58] bin wang
Description:
when set retry_count value
If default value is equal to user option 
It is not necessary to run below may cost few time.

How to repeat:
just add if  default value is equal to user option then  return

mysql> set net_retry_count=10
    -> ;

Suggested fix:
void my_net_set_retry_count(NET *net, uint retry_count) {
  DBUG_TRACE;
  DBUG_PRINT("enter", ("retry_count: %d", retry_count));
++  if (net->retry_count == timeout){
++    return;
++  }
  net->retry_count = retry_count;
  if (net->vio) net->vio->retry_count = retry_count;
}
[22 Feb 2023 14:59] bin wang
suggested add  patch

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: net_serv.patch (application/octet-stream, text), 461 bytes.

[22 Feb 2023 16:33] MySQL Verification Team
Hi Mr. wang,

Thank you for your bug report.

However, this is not a bug.

First of all retry_count and timeout have nothing in common.

Second , there are two timeouts. If you would like to skip timeout setting, it would not be acceptable to us. Adding an unnecessary condition would just slow down our server and all clients based on our C API.

Not a bug.
[22 Feb 2023 16:34] MySQL Verification Team
We simply do not like adding unnecessary code into that part of the client and server.