Bug #86410 Possible unintended usage of "precision" variable
Submitted: 22 May 2017 15:30 Modified: 30 Jun 2017 10:41
Reporter: Petru-Florin Mihancea Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S2 (Serious)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[22 May 2017 15:30] Petru-Florin Mihancea
Description:
Hi,

While experimenting with a CodeSonar plugin we develop, we noticed a potential bug in file "mysql-server/mysys/mf_iocache2.c" line 375:

precision= (int) va_arg(args, int);

Shouldn't you set the minimum_width variable (instead of precision)? It looks you intend to set minimum_width as on the other branch of the involved if-statement (line 381).

Thank you.

How to repeat:
This is a bug observed at the source code level.
[24 May 2017 15:45] MySQL Verification Team
This is indeed a fragrant case of an error in the copy / paste.

Verified.
[30 Jun 2017 10:41] Paul DuBois
Posted by developer:
 
Fixed in 5.7.20, 8.0.3.

Code cleanup (problem found by observation, without apparent user consequence). No changelog entry needed.