Bug #88634 Compile warning on 5.6.38 optimized build
Submitted: 24 Nov 2017 4:26 Modified: 19 Nov 2018 15:12
Reporter: Roel Van de Paar Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.6.38 OS:Any
Assigned to: CPU Architecture:Any

[24 Nov 2017 4:26] Roel Van de Paar
Description:
[ 76%] Building CXX object sql/CMakeFiles/sql.dir/sql_planner.cc.o
/git/mysql-server-copy_opt/sql/sql_planner.cc: In member function ‘void Optimize_table_order::best_access_path(JOIN_TAB*, table_map, uint, bool, double, POSITION*, POSITION*)’:
/git/mysql-server-copy_opt/sql/sql_planner.cc:335:52: warning: ‘loose_scan_opt.Loose_scan_opt::best_max_loose_keypart’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       pos->loosescan_parts= best_max_loose_keypart + 1;
                                                    ^
/git/mysql-server-copy_opt/sql/sql_planner.cc:431:18: note: ‘loose_scan_opt.Loose_scan_opt::best_max_loose_keypart’ was declared here
   Loose_scan_opt loose_scan_opt;
                  ^
/git/mysql-server-copy_opt/sql/sql_planner.cc:333:54: warning: ‘loose_scan_opt.Loose_scan_opt::best_loose_scan_start_key’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       pos->key=             best_loose_scan_start_key;
                                                      ^
/git/mysql-server-copy_opt/sql/sql_planner.cc:431:18: note: ‘loose_scan_opt.Loose_scan_opt::best_loose_scan_start_key’ was declared here
   Loose_scan_opt loose_scan_opt;
                  ^
/git/mysql-server-copy_opt/sql/sql_planner.cc:332:52: warning: ‘loose_scan_opt.Loose_scan_opt::best_loose_scan_records’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       pos->records_read=    best_loose_scan_records;
                                                    ^
/git/mysql-server-copy_opt/sql/sql_planner.cc:431:18: note: ‘loose_scan_opt.Loose_scan_opt::best_loose_scan_records’ was declared here
   Loose_scan_opt loose_scan_opt;
                  ^
/git/mysql-server-copy_opt/sql/sql_planner.cc:334:48: warning: ‘loose_scan_opt.Loose_scan_opt::best_loose_scan_key’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       pos->loosescan_key=   best_loose_scan_key;
                                                ^
/git/mysql-server-copy_opt/sql/sql_planner.cc:431:18: note: ‘loose_scan_opt.Loose_scan_opt::best_loose_scan_key’ was declared here
   Loose_scan_opt loose_scan_opt;
                  ^
[ 76%] Building CXX object sql/CMakeFiles/sql.dir/sql_plugin.cc.o
[ 76%] Building CXX object sql/CMakeFiles/sql.dir/sql_prepare.cc.o

How to repeat:
Centos 7 x64, 7.4.1708 (not sure if it matters)

cmake . -DWITH_ZLIB=system -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp -DWITH_SSL=system -DWITH_PAM=ON
[24 Nov 2017 6:42] MySQL Verification Team
Hello Roel,

Thank you for the report.

Thanks,
Umesh
[24 Nov 2017 7:07] MySQL Verification Team
https://bugs.mysql.com/bug.php?id=77637
[19 Nov 2018 15:12] Dyre Tjeldvoll
Posted by developer:
 
Thank you for bringing this to our attention! Such issues, including this one, are fixed as they are encountered but only on the latest development branch (trunk). And as such fixes are not normally backported to GA releases, we need to close this bug.