Bug #58279 | Incorrect enabling of UNIV_DEBUG in debug builds | ||
---|---|---|---|
Submitted: | 18 Nov 2010 9:44 | Modified: | 12 Jan 2011 21:38 |
Reporter: | John Embretsen | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 5.5.6-m3-Celosia | OS: | Any |
Assigned to: | Vasil Dimov | CPU Architecture: | Any |
Tags: | cmake |
[18 Nov 2010 9:44]
John Embretsen
[19 Nov 2010 13:33]
Vasil Dimov
After reading all posts here and on the related Bug#58231 the solution seems pretty obvious to me, I am going to commit this patch to mysql-5.5-innodb: --- cut --- diff --git i/storage/innobase/CMakeLists.txt w/storage/innobase/CMakeLists.txt index 587e39d..f0bfd74 100644 --- i/storage/innobase/CMakeLists.txt +++ w/storage/innobase/CMakeLists.txt @@ -40,10 +40,9 @@ IF(UNIX) ENDIF() ENDIF() -# Enable InnoDB's UNIV_DEBUG if MySQL's WITH_DEBUG is defined -IF(WITH_DEBUG) - ADD_DEFINITIONS("-DUNIV_DEBUG") -ENDIF() +# Enable InnoDB's UNIV_DEBUG for debug builds +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DUNIV_DEBUG") +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DUNIV_DEBUG") IF(NOT MSVC) # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not --- cut --- Thanks for the thorough explanation!
[22 Dec 2010 21:31]
Bugs System
Pushed into mysql-trunk 5.6.1 (revid:alexander.nozdrin@oracle.com-20101222212842-y0t3ibtd32wd9qaw) (version source revid:alexander.nozdrin@oracle.com-20101222212842-y0t3ibtd32wd9qaw) (merge vers: 5.6.1) (pib:24)
[8 Jan 2011 15:10]
Bugs System
Pushed into mysql-5.5 5.5.9 (revid:vasil.dimov@oracle.com-20110108150508-gpanhz48z8069qot) (version source revid:vasil.dimov@oracle.com-20110108150048-b1y9m8xe72hay0ch) (merge vers: 5.5.9) (pib:24)
[12 Jan 2011 21:38]
John Russell
Adding to change log: The command to create a debug build (cmake -DWITH_DEBUG ...) now automatically sets the InnoDB debugging flag UNIV_DEBUG on all platforms. Formerly, the UNIV_DEBUG flag might not be set for Windows platforms with Visual Studio and not on OS X with Xcode.
[13 Jan 2011 0:19]
Vladislav Vaintroub
@John(Russel) CMAKE_BUILD_TYPE=Debug is specific to Makefiles. We(and CMake) support non-Makefiles as well, and CMAKE_BUILD_TYPE does not have any effect here. Here is why. If you have something that is not makefiles (Visual Studio projects or Xcode projects), then there are different mechanism to enable debug build at the *build* time, rather than at the configure (cmake) time. Put it simpler, with VS (and Xcode) you run "cmake" once and get a project that has debug and release configurations, and you can click in GUI or provide command line parameter for devenv/xcodebuild to compile either for debug or release. With makefiles, you cannot do that. You need to run cmake once for release builds, and again (in a different build directory) for debug builds. You cannot tweak build type at the build time (i.e there is no such thing as "make DEBUG=yes") What that means in context of the bug, is that CMAKE_C{XX}_FLAGS_DEBUG is only portable way to define debug-only flags in CMake, as this works for both Makefiles and non-Makefiles.
[13 Jan 2011 7:40]
Vasil Dimov
Just remove "cmake -DWITH_DEBUG ...)" from "The command to create a debug build (cmake -DWITH_DEBUG ...) now automatically sets the InnoDB debugging flag UNIV_DEBUG on all platforms. Formerly, the UNIV_DEBUG flag might not be set for Windows platforms with Visual Studio and not on OS X with Xcode."