Skip to content

Commit

Permalink
Fix WITH_INNODB_EXTRA_DEBUG
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dr-m committed Apr 30, 2018
1 parent a1fe7d7 commit 8cd55ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
4 changes: 2 additions & 2 deletions storage/innobase/buf/buf0lru.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 1 addition & 20 deletions storage/innobase/innodb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/page/page0zip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 8cd55ae

Please sign in to comment.