Bug #90470 Possible unintended var usage "sql/rpl_info_factory.cc" line 536
Submitted: 17 Apr 2018 11:05 Modified: 17 Apr 2018 15:59
Reporter: Petru-Florin Mihancea Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[17 Apr 2018 11:05] Petru-Florin Mihancea
Description:
While experimenting with a CodeSonar plugin we develop, we noticed a potential bug in file "sql/rpl_info_factory.cc" line 536 function Rpl_info_factory::init_repository_metadata:

my_stpcpy(mi_file_data.name, master_info_file);
my_stpcpy(mi_file_data.pattern, master_info_file);
rli_file_data.name_indexed= false; //HERE

Shouldn't you set the field of "mi_file_data" instead of the field of "rli_file_data"?

Thanks,
Petru Florin Mihancea

How to repeat:
The potential issue has been detected automatically using static analysis.
[17 Apr 2018 14:09] Sinisa Milivojevic
Hi,

Thank you for your bug report.

You are writing about source code files and bug numbers, while you do not state which version and which release are you writing about.

If this is a new code in the patch that is not released yet, then we can not verify it until it is released.
[17 Apr 2018 15:02] Petru-Florin Mihancea
Ups, sorry! It is version 5.7.
[17 Apr 2018 15:59] Sinisa Milivojevic
Thank you very much for your contribution.

It is indeed a bug.

Verified as reported.