Bug #80415 innodb warning with innodb encryption code when building 5.7.11
Submitted: 17 Feb 2016 19:08 Modified: 25 Feb 2016 11:22
Reporter: Richard Prohaska Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7.11 OS:Ubuntu (15.10)
Assigned to: CPU Architecture:Any

[17 Feb 2016 19:08] Richard Prohaska
Description:
Using clang to build mysql 5.7.11, see the following compilation warning.  The code should be cleaned up.

/home/rfp/projects/mysql.57.tsan/mysql-server/storage/innobase/fil/fil0fil.cc:813:15: warning: comparison of array 'space->encryption_key' equal to a null pointer is always false [-Wtautological-pointer-\
compare]
                        if (space->encryption_key == NULL
                            ~~~~~~~^~~~~~~~~~~~~~    ~~~~
/home/rfp/projects/mysql.57.tsan/mysql-server/storage/innobase/fil/fil0fil.cc:814:18: warning: comparison of array 'space->encryption_iv' equal to a null pointer is always false [-Wtautological-pointer-c\
ompare]
                            || space->encryption_iv == NULL
                               ~~~~~~~^~~~~~~~~~~~~    ~~~~

How to repeat:
CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Debug ....
make
[18 Feb 2016 8:58] MySQL Verification Team
Hello Richard Prohaska,

Thank you for the report.

Thanks,
Umesh
[18 Feb 2016 8:59] MySQL Verification Team
-- with 5.7.11 

ushastry@ubuntu1510:~/Downloads/80415/mysql-5.7.11$ CC=clang CXX=clang++ cmake . -DCMAKE_BUILD_TYPE=Debug -DDOWNLOAD_BOOST=1 -DWITH_BOOST=../boost
-- Running cmake version 3.2.2
-- Could NOT find Git (missing:  GIT_EXECUTABLE) 
-- Configuring with MAX_INDEXES = 64U
-- The C compiler identification is Clang 3.6.2
-- The CXX compiler identification is Clang 3.6.2
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works

ushastry@ubuntu1510:~/Downloads/80415/mysql-5.7.11$ make
.

[ 30%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/fil/fil0fil.cc.o
/home/ushastry/Downloads/80415/mysql-5.7.11/storage/innobase/fil/fil0fil.cc:813:15: warning: comparison of array 'space->encryption_key' equal to a null pointer is
      always false [-Wtautological-pointer-compare]
                        if (space->encryption_key == NULL
                            ~~~~~~~^~~~~~~~~~~~~~    ~~~~
/home/ushastry/Downloads/80415/mysql-5.7.11/storage/innobase/fil/fil0fil.cc:814:18: warning: comparison of array 'space->encryption_iv' equal to a null pointer is always
      false [-Wtautological-pointer-compare]
                            || space->encryption_iv == NULL
                               ~~~~~~~^~~~~~~~~~~~~    ~~~~
2 warnings generated.
[25 Feb 2016 11:22] Erlend Dahl
This has been fixed in the upcoming 5.7.12 release.