Bug #115191 optimize for net_write_buff
Submitted: 1 Jun 4:29 Modified: 1 Jun 8:59
Reporter: alex xing (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S5 (Performance)
Version:8.0.37 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[1 Jun 4:29] alex xing
Description:
optimize for net_write_buff
if Send empty packet, the parameter(size_t len) of my_net_write is 0. And in this case , the parameter(size_t len) of net_write_buff is also 0.

just like code in handle_local_infile:

handle_local_infile(){
    (void)my_net_write(net, (const uchar *)"", 0); /* Server needs one packet */
}

my_net_write(){
    return net_write_buff(net, packet, len);
}

In this case, there is no need for some judgment logic for net_write_buff

How to repeat:
just read the code

Suggested fix:
optimize as the below patch
[1 Jun 4:30] alex xing
a simple patch to describe the optimization

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

Contribution: optimize_net_write_buff.patch (application/octet-stream, text), 966 bytes.

[1 Jun 8:59] MySQL Verification Team
Hello Alex Xing,

Thank you for the report and contribution.

regards,
umesh