Bug #94511 Contribution: Update sql_sort.h
Submitted: 28 Feb 2019 15:06 Modified: 26 Jun 2019 10:41
Reporter: OCA Admin (OCA) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[28 Feb 2019 15:06] OCA Admin
Description:
This bug tracks a contribution by mengkang zhou (Github user: zhoumengkang) as described in http://github.com/mysql/mysql-server/pull/249

How to repeat:
See description

Suggested fix:
See contribution code attached
[28 Feb 2019 15:06] OCA Admin
Contribution submitted via Github - Update sql_sort.h 
(*) Contribution by mengkang zhou (Github zhoumengkang, mysql-server/pull/249#issuecomment-468262030): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_253087590.txt (text/plain), 792 bytes.

[28 Feb 2019 15:11] MySQL Verification Team
Thank you for the contribution.
[4 Mar 2019 12:25] Tor Didriksen
Posted by developer:
 
The 'null bits' are for 'addon fields' only.
You can verify by reading the "prepare phase" in get_addon_fields,

In the "execute phase" in  Sort_param::make_sortkey(), we do
if (using_addon_fields())
{
  ...
    for ( ; addonf != addon_fields->end(); ++addonf)
    {
      Field *field= addonf->field;
      if (addonf->null_bit && field->is_null())
      {
        <set the null bit>
      }
      else
      {
        <pack field into buffer>
      }
    }
 }

And finally when reading the sorted result in Filesort_info::unpack_addon_fields
[9 Mar 2020 12:11] Frederic Descamps
Thank you for your patch but after being processed by our development department, the conclusion is that your patch changes a comment in the source code, but the suggested change doesn't match what the code does. The existing comment is correct.

Regards