From 8cd55ae2a998626631a41c8d3a4ec38c59b4b607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 30 Apr 2018 13:45:25 +0300 Subject: Fix WITH_INNODB_EXTRA_DEBUG The checks that used to be enabled by the flags UNIV_AHI_DEBUG, UNIV_DDL_DEBUG, UNIV_DEBUG_FILE_ACCESSES were already enabled in debug builds. So, there is no point in setting these. Only UNIV_ZIP_DEBUG is set independently of the debug build. Allow WITH_INNODB_EXTRA_DEBUG to be set for non-debug builds as well. Currently it only implies UNIV_ZIP_DEBUG, that is, extra validation for operations on ROW_FORMAT=COMPRESSED tables. page_zip_validate_low(): Allow the code to be built on non-debug server. buf_LRU_block_remove_hashed(): Allow the code to be built without WITH_INNODB_AHI. --- storage/innobase/buf/buf0lru.cc | 4 ++-- storage/innobase/innodb.cmake | 21 +-------------------- storage/innobase/page/page0zip.cc | 2 +- 3 files changed, 4 insertions(+), 23 deletions(-) (limited to 'storage/innobase') diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index 8ec2c883075..88eeaa555e6 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -1947,11 +1947,11 @@ buf_LRU_block_remove_hashed( break; case FIL_PAGE_INDEX: case FIL_PAGE_RTREE: -#ifdef UNIV_ZIP_DEBUG +#if defined UNIV_ZIP_DEBUG && defined BTR_CUR_HASH_ADAPT ut_a(page_zip_validate( &bpage->zip, page, ((buf_block_t*) bpage)->index)); -#endif /* UNIV_ZIP_DEBUG */ +#endif /* UNIV_ZIP_DEBUG && BTR_CUR_HASH_ADAPT */ break; default: ib::error() << "The compressed page to be" diff --git a/storage/innobase/innodb.cmake b/storage/innobase/innodb.cmake index 50d6b4bbeec..a728dd08c0d 100644 --- a/storage/innobase/innodb.cmake +++ b/storage/innobase/innodb.cmake @@ -49,12 +49,6 @@ ELSE() ENDMACRO() ENDIF() -## MySQL 5.7 LZ4 (not needed) -##IF(LZ4_INCLUDE_DIR AND LZ4_LIBRARY) -## ADD_DEFINITIONS(-DHAVE_LZ4=1) -## INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR}) -##ENDIF() - # OS tests IF(UNIX) IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") @@ -127,20 +121,7 @@ ENDIF() OPTION(WITH_INNODB_EXTRA_DEBUG "Enable extra InnoDB debug checks" OFF) IF(WITH_INNODB_EXTRA_DEBUG) - IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - MESSAGE(FATAL_ERROR "WITH_INNODB_EXTRA_DEBUG can be enabled only in debug builds") - ENDIF() - - SET(EXTRA_DEBUG_FLAGS "") - IF(WITH_INNODB_AHI) - SET(EXTRA_DEBUG_FLAGS "${EXTRA_DEBUG_FLAGS} -DUNIV_AHI_DEBUG") - ENDIF() - SET(EXTRA_DEBUG_FLAGS "${EXTRA_DEBUG_FLAGS} -DUNIV_DDL_DEBUG") - SET(EXTRA_DEBUG_FLAGS "${EXTRA_DEBUG_FLAGS} -DUNIV_DEBUG_FILE_ACCESSES") - SET(EXTRA_DEBUG_FLAGS "${EXTRA_DEBUG_FLAGS} -DUNIV_ZIP_DEBUG") - - SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${EXTRA_DEBUG_FLAGS}") - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${EXTRA_DEBUG_FLAGS}") + ADD_DEFINITIONS(-DUNIV_ZIP_DEBUG) ENDIF() CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU) diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 9b0f6dd9737..f13e20ff447 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -3469,7 +3469,7 @@ page_zip_validate_low( page + PAGE_NEW_INFIMUM, TRUE); trec = page_rec_get_next_low( temp_page + PAGE_NEW_INFIMUM, TRUE); - ut_d(const bool is_leaf = page_is_leaf(page)); + const bool is_leaf = page_is_leaf(page); do { if (page_offset(rec) != page_offset(trec)) { -- cgit v1.2.1