From 19d25e5658d120cb671c119c7bc5724d72da407f Mon Sep 17 00:00:00 2001 From: Roy Lyseng Date: Mon, 1 Mar 2010 21:19:47 +0100 Subject: [PATCH 1/3] WL#5252: deprecate --optimizer_search_depth=63 Followup: Changes in sys_vars test suite mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result Added warnings. --- .../sys_vars/r/optimizer_search_depth_basic.result | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result b/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result index 4d94fb02be7..de448d3e2fc 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result +++ b/mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result @@ -10,6 +10,7 @@ SELECT @start_session_value; SET @@global.optimizer_search_depth = 100; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '100' +Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SET @@global.optimizer_search_depth = DEFAULT; SELECT @@global.optimizer_search_depth; @@global.optimizer_search_depth @@ -17,6 +18,7 @@ SELECT @@global.optimizer_search_depth; SET @@session.optimizer_search_depth = 200; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '200' +Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SET @@session.optimizer_search_depth = DEFAULT; SELECT @@session.optimizer_search_depth; @@session.optimizer_search_depth @@ -44,6 +46,8 @@ SELECT @@global.optimizer_search_depth; @@global.optimizer_search_depth 62 SET @@global.optimizer_search_depth = 63; +Warnings: +Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SELECT @@global.optimizer_search_depth; @@global.optimizer_search_depth 63 @@ -61,6 +65,8 @@ SELECT @@session.optimizer_search_depth; @@session.optimizer_search_depth 62 SET @@session.optimizer_search_depth = 63; +Warnings: +Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SELECT @@session.optimizer_search_depth; @@session.optimizer_search_depth 63 @@ -68,6 +74,7 @@ SELECT @@session.optimizer_search_depth; SET @@global.optimizer_search_depth = 64; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '64' +Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SELECT @@global.optimizer_search_depth; @@global.optimizer_search_depth 63 @@ -80,6 +87,7 @@ SELECT @@global.optimizer_search_depth; SET @@global.optimizer_search_depth = 65536; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '65536' +Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SELECT @@global.optimizer_search_depth; @@global.optimizer_search_depth 63 @@ -96,6 +104,7 @@ SELECT @@global.optimizer_search_depth; SET @@session.optimizer_search_depth = 64; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '64' +Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SELECT @@session.optimizer_search_depth; @@session.optimizer_search_depth 63 @@ -110,6 +119,7 @@ ERROR 42000: Incorrect argument type to variable 'optimizer_search_depth' SET @@session.optimizer_search_depth = 65550; Warnings: Warning 1292 Truncated incorrect optimizer_search_depth value: '65550' +Warning 1287 'optimizer-search-depth=63' is deprecated and will be removed in a future release. Please use a search depth less than 63 instead SELECT @@session.optimizer_search_depth; @@session.optimizer_search_depth 63 From 5cc238d3b0eb4b703d9b9546f62415bba1cd934d Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 1 Mar 2010 17:10:01 -0700 Subject: [PATCH 2/3] Bug#51612 Un initialized locker_lost variable in pfs_instr.cc Fixed the missing initialization of locker_lost. This fix is not strictly necessary, but is desirable to re-align the code from 5.5 and 6.0, and reduce the spurious code differences. This will facilitate maintenance and help to apply patches cleanly, for merges. --- storage/perfschema/pfs_instr.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc index 557ec1c14b5..28b54cc6979 100644 --- a/storage/perfschema/pfs_instr.cc +++ b/storage/perfschema/pfs_instr.cc @@ -66,7 +66,7 @@ ulong events_waits_history_per_thread; /** Number of instruments class per thread. */ ulong instr_class_per_thread; /** Number of locker lost. @sa LOCKER_STACK_SIZE. */ -ulong locker_lost; +ulong locker_lost= 0; /** Mutex instrumentation instances array. From e1384dc718890ed3950795cbc4f425dd453ab018 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 2 Mar 2010 01:53:15 +0100 Subject: [PATCH 3/3] Fix WITH_DEBUG problems in CMake build, so people who use configure wrappers do not suffer. The problem was that when custom C flags were defined with in environment variable CFLAGS, WITH_DEBUG did not have any effect. Also, switch from WITH_DEBUG=ON to WITH_DEBUG=OFF was not handled correctly .Expected is switch to with RelwithDebInfo or when custom compiler flags are defined, to None. --- CMakeLists.txt | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 036d0cdb9d6..d20939f33ac 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,26 +32,32 @@ IF(DEFINED CMAKE_BUILD_TYPE) SET(HAVE_CMAKE_BUILD_TYPE TRUE) ENDIF() SET(CUSTOM_C_FLAGS $ENV{CFLAGS}) -IF(NOT CUSTOM_C_FLAGS) - SET(CUSTOM_C_FLAGS ${CMAKE_C_FLAGS}) -ENDIF() -OPTION(WITH_DEBUG "Use dbug" OFF) +OPTION(WITH_DEBUG "Use dbug/safemutex" OFF) OPTION(WITH_DEBUG_FULL "Use dbug and safemalloc/safemutex. Slow" OFF) -IF(NOT HAVE_CMAKE_BUILD_TYPE) - IF(BUILD_CONFIG OR NOT CUSTOM_C_FLAGS) - IF(WITH_DEBUG) - SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Debug build" FORCE) - ELSE() - SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING - "RelWithDebInfo build" FORCE) - ENDIF() - ENDIF() -ENDIF() -IF(WITH_DEBUG_FULL) - SET(WITH_DEBUG ON CACHE BOOL "Use DBUG") +# We choose to provide WITH_DEBUG as alias to standard CMAKE_BUILD_TYPE=Debug +# which turns out to be not trivial, as this involves synchronization +# between CMAKE_BUILD_TYPE and WITH_DEBUG. Besides, we have to deal with cases +# where WITH_DEBUG is reset from ON to OFF and here we need to reset +# CMAKE_BUILD_TYPE to either none or default RelWithDebInfo + +SET(BUILDTYPE_DOCSTRING + "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or + CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel") + +IF(WITH_DEBUG OR WITH_DEBUG_FULL) + SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING ${BUILDTYPE_DOCSTRING} FORCE) + SET(OLD_WITH_DEBUG 1 CACHE INTERNAL "" FORCE) +ELSEIF(NOT HAVE_CMAKE_BUILD_TYPE OR OLD_WITH_DEBUG) + IF(CUSTOM_C_FLAGS) + SET(CMAKE_BUILD_TYPE "" CACHE STRING ${BUILDTYPE_DOCSTRING} FORCE) + ELSE(CMAKE_BUILD_TYPE MATCHES "Debug" OR NOT HAVE_CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING + ${BUILDTYPE_DOCSTRING} FORCE) + ENDIF() + SET(OLD_WITH_DEBUG 0 CACHE INTERNAL "" FORCE) ENDIF() IF(BUILD_CONFIG)