Bug #87914 Possible unintended usage of a field in file "sql/sql_partition.cc"
Submitted: 29 Sep 2017 11:33 Modified: 4 Oct 2017 14:20
Reporter: Petru-Florin Mihancea Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[29 Sep 2017 11:33] Petru-Florin Mihancea
Description:
Hi,

While experimenting with a CodeSonar plugin we develop, we noticed a potential bug in file "sql/sql_partition.cc" line 1483 function "set_up_partition_func_pointers":

DBUG_ASSERT(part_info->get_partition_id);
      if (!part_info->column_list)
      {
        part_info->get_part_partition_id_charset= part_info->get_partition_id;
        part_info->get_part_partition_id= get_part_id_charset_func_part;             //HERE
      }
    }

In the marked line, should be set the "get_partition_id" field (instead of get_part_partition_id)?

Regards,
Petru Mihancea

How to repeat:
This issue has been detected automatically via static analysis.
[4 Oct 2017 14:20] Sinisa Milivojevic
Hi!

Actually, I think that you are right. Not only that, it seems to me that both lines of the code are wrong.

It is also irrelevant that this part of code will be deprecated in the future It is yet unknown as to when exactly.

So, verified ...