diff options
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 4 | ||||
-rw-r--r-- | storage/innobase/include/dict0mem.h | 2 | ||||
-rw-r--r-- | storage/innobase/include/sync0types.h | 4 | ||||
-rw-r--r-- | storage/innobase/include/ut0dbg.h | 2 | ||||
-rw-r--r-- | storage/innobase/lock/lock0lock.cc | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0merge.cc | 2 | ||||
-rw-r--r-- | storage/maria/ma_bitmap.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_blockrec.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_key_recover.c | 4 | ||||
-rw-r--r-- | storage/maria/ma_loghandler.c | 4 | ||||
-rw-r--r-- | storage/maria/ma_page.c | 6 | ||||
-rw-r--r-- | storage/maria/ma_pagecache.c | 8 | ||||
-rw-r--r-- | storage/maria/ma_pagecrc.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_state.c | 2 | ||||
-rw-r--r-- | storage/mroonga/lib/mrn_debug_column_access.cpp | 4 | ||||
-rw-r--r-- | storage/mroonga/lib/mrn_debug_column_access.hpp | 2 | ||||
-rw-r--r-- | storage/rocksdb/rdb_datadic.h | 4 | ||||
-rw-r--r-- | storage/tokudb/tokudb_thread.h | 44 |
18 files changed, 51 insertions, 49 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 2887e66c3ad..de752e93b55 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3087,7 +3087,7 @@ ha_innobase::update_thd( m_user_thd, thd)); /* The table should have been opened in ha_innobase::open(). */ - DBUG_ASSERT(m_prebuilt->table->n_ref_count > 0); + ut_ad(m_prebuilt->table->n_ref_count > 0); trx_t* trx = check_trx_exists(thd); @@ -14340,7 +14340,7 @@ ha_innobase::info_low( m_prebuilt->trx->op_info = "returning various info to MariaDB"; ib_table = m_prebuilt->table; - DBUG_ASSERT(ib_table->n_ref_count > 0); + ut_ad(ib_table->n_ref_count > 0); if (flag & HA_STATUS_TIME) { if (is_analyze || innobase_stats_on_metadata) { diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 04c4af36aa9..0155d1d5d20 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -1677,7 +1677,7 @@ struct dict_table_t { It is protected by lock_sys->mutex. */ ulint n_rec_locks; -#ifndef UNIV_DEBUG +#ifndef DBUG_ASSERT_EXISTS private: #endif /** Count of how many handles are opened to this table. Dropping of the diff --git a/storage/innobase/include/sync0types.h b/storage/innobase/include/sync0types.h index c2864fa2f56..e08c978fa40 100644 --- a/storage/innobase/include/sync0types.h +++ b/storage/innobase/include/sync0types.h @@ -493,10 +493,10 @@ struct OSMutex { } private: -#ifdef UNIV_DEBUG +#ifdef DBUG_ASSERT_EXISTS /** true if the mutex has been freed/destroyed. */ bool m_freed; -#endif /* UNIV_DEBUG */ +#endif /* DBUG_ASSERT_EXISTS */ sys_mutex_t m_mutex; }; diff --git a/storage/innobase/include/ut0dbg.h b/storage/innobase/include/ut0dbg.h index a860196e3db..a6be74b816f 100644 --- a/storage/innobase/include/ut0dbg.h +++ b/storage/innobase/include/ut0dbg.h @@ -61,7 +61,7 @@ ut_dbg_assertion_failed( ut_dbg_assertion_failed(0, __FILE__, __LINE__) /** Debug assertion */ -#define ut_ad DBUG_ASSERT +#define ut_ad DBUG_SLOW_ASSERT #if defined(UNIV_DEBUG) || !defined(DBUG_OFF) /** Debug statement. Does nothing unless UNIV_DEBUG is defined. */ #define ut_d(EXPR) EXPR diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 717e65244cd..3166bb810a1 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -1865,7 +1865,7 @@ lock_queue_validate( hash_table_t* hash; hash_cell_t* cell; lock_t* next; - bool wait_lock = false; + bool wait_lock __attribute__((unused))= false; if (in_lock == NULL) { return true; diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index ccff9726732..112ca9c3df2 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1443,7 +1443,7 @@ row_merge_write_rec_low( } memcpy(b, mrec - rec_offs_extra_size(offsets), rec_offs_size(offsets)); - DBUG_ASSERT(b + rec_offs_size(offsets) == end); + DBUG_SLOW_ASSERT(b + rec_offs_size(offsets) == end); DBUG_VOID_RETURN; } diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c index 0abfa34a85f..977dd888365 100644 --- a/storage/maria/ma_bitmap.c +++ b/storage/maria/ma_bitmap.c @@ -2926,7 +2926,7 @@ int _ma_bitmap_create_first(MARIA_SHARE *share) static my_bool flush_log_for_bitmap(PAGECACHE_IO_HOOK_ARGS *args __attribute__ ((unused))) { -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS const MARIA_SHARE *share= (MARIA_SHARE*)args->data; #endif DBUG_ENTER("flush_log_for_bitmap"); diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index 57596558208..a9476f25173 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -6893,7 +6893,7 @@ uint _ma_apply_redo_insert_row_blobs(MARIA_HA *info, } else { -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS uchar found_page_type= (buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK); #endif if (lsn_korr(buff) >= lsn) diff --git a/storage/maria/ma_key_recover.c b/storage/maria/ma_key_recover.c index 8b6342b76b5..d400bfcb7f1 100644 --- a/storage/maria/ma_key_recover.c +++ b/storage/maria/ma_key_recover.c @@ -946,7 +946,7 @@ uint _ma_apply_redo_index(MARIA_HA *info, uint page_offset= 0, org_page_length; uint page_length, keypage_header, keynr; uint max_page_size= share->max_index_block_size; -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS uint new_page_length= 0; #endif int result; @@ -1110,7 +1110,7 @@ uint _ma_apply_redo_index(MARIA_HA *info, DBUG_PRINT("redo", ("org_page_length: %u new_page_length: %u", uint2korr(header), uint2korr(header+2))); DBUG_ASSERT(uint2korr(header) == page_length); -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS new_page_length= MY_MIN(uint2korr(header+2), max_page_size); #endif header+= 4; diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index defa11ad6b4..94a5c9f1e71 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -3010,7 +3010,7 @@ restart: if (cmp_translog_addr(addr, in_buffers) >= 0) { uint16 buffer_no= log_descriptor.bc.buffer_no; -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS uint16 buffer_start= buffer_no; #endif struct st_translog_buffer *buffer_unlock= log_descriptor.bc.buffer; @@ -6228,7 +6228,7 @@ my_bool translog_write_record(LSN *lsn, DBUG_ASSERT(translog_status == TRANSLOG_OK || translog_status == TRANSLOG_READONLY); DBUG_ASSERT(type != 0); - DBUG_ASSERT((uint)type <= max_allowed_translog_type); + DBUG_SLOW_ASSERT((uint)type <= max_allowed_translog_type); if (unlikely(translog_status != TRANSLOG_OK)) { DBUG_PRINT("error", ("Transaction log is write protected")); diff --git a/storage/maria/ma_page.c b/storage/maria/ma_page.c index 4021fb8e161..d6acc0520c1 100644 --- a/storage/maria/ma_page.c +++ b/storage/maria/ma_page.c @@ -420,11 +420,11 @@ my_off_t _ma_new(register MARIA_HA *info, int level, Next deleted page's number is in the header of the present page (single linked list): */ -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS my_off_t key_del_current; #endif share->key_del_current= mi_sizekorr(buff+share->keypage_header); -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS key_del_current= share->key_del_current; DBUG_ASSERT((key_del_current != 0) && ((key_del_current == HA_OFFSET_ERROR) || @@ -512,7 +512,7 @@ static my_bool _ma_log_compact_keypage(MARIA_PAGE *ma_page, @param min_read_from Remove all trids from page less than this @retval 0 Ok - ®retval 1 Error; my_errno contains the error + ®retval 1 Error; my_errno contains the error */ my_bool _ma_compact_keypage(MARIA_PAGE *ma_page, TrID min_read_from) diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index a1c407967b7..9449c730a04 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -2044,7 +2044,7 @@ restart: DBUG_ASSERT(block->rlocks_queue == 0); DBUG_ASSERT(block->pins == 0); block->status= 0; -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS block->type= PAGECACHE_EMPTY_PAGE; #endif DBUG_ASSERT(reg_req); @@ -2187,7 +2187,7 @@ restart: block->last_hit_time= 0; block->status= error ? PCBLOCK_ERROR : 0; block->error= error ? (int16) my_errno : 0; -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS block->type= PAGECACHE_EMPTY_PAGE; if (error) my_debug_put_break_here(); @@ -4274,7 +4274,7 @@ static my_bool free_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block, DBUG_ASSERT(block->requests >= 1); DBUG_ASSERT(block->next_used == NULL); block->status= 0; -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS block->type= PAGECACHE_EMPTY_PAGE; #endif block->rec_lsn= LSN_MAX; @@ -4781,10 +4781,8 @@ restart: wqueue_release_queue(&us_flusher.flush_queue); } -#ifndef DBUG_OFF DBUG_EXECUTE("check_pagecache", test_key_cache(pagecache, "end of flush_pagecache_blocks", 0);); -#endif if (cache != cache_buff) my_free(cache); if (rc != 0) diff --git a/storage/maria/ma_pagecrc.c b/storage/maria/ma_pagecrc.c index 838913cc3ed..8982c7e5c09 100644 --- a/storage/maria/ma_pagecrc.c +++ b/storage/maria/ma_pagecrc.c @@ -287,7 +287,7 @@ my_bool maria_page_crc_check_none(int res, my_bool maria_page_filler_set_normal(PAGECACHE_IO_HOOK_ARGS *args) { uchar *page= args->page; -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS pgcache_page_no_t page_no= args->pageno; #endif MARIA_SHARE *share= (MARIA_SHARE *)args->data; diff --git a/storage/maria/ma_state.c b/storage/maria/ma_state.c index 15cc48ad468..817e1b69ddf 100644 --- a/storage/maria/ma_state.c +++ b/storage/maria/ma_state.c @@ -533,7 +533,7 @@ my_bool _ma_trnman_end_trans_hook(TRN *trn, my_bool commit, } else { -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS /* We need to keep share->in_trans correct in the debug library because of the assert in maria_close() diff --git a/storage/mroonga/lib/mrn_debug_column_access.cpp b/storage/mroonga/lib/mrn_debug_column_access.cpp index ed7cacae90f..db0c303ddd0 100644 --- a/storage/mroonga/lib/mrn_debug_column_access.cpp +++ b/storage/mroonga/lib/mrn_debug_column_access.cpp @@ -23,13 +23,13 @@ namespace mrn { DebugColumnAccess::DebugColumnAccess(TABLE *table, MY_BITMAP *bitmap) : table_(table), bitmap_(bitmap) { -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS map_ = dbug_tmp_use_all_columns(table_, bitmap_); #endif } DebugColumnAccess::~DebugColumnAccess() { -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS dbug_tmp_restore_column_map(bitmap_, map_); #endif } diff --git a/storage/mroonga/lib/mrn_debug_column_access.hpp b/storage/mroonga/lib/mrn_debug_column_access.hpp index 1548b4d8459..4887849349e 100644 --- a/storage/mroonga/lib/mrn_debug_column_access.hpp +++ b/storage/mroonga/lib/mrn_debug_column_access.hpp @@ -26,7 +26,7 @@ namespace mrn { class DebugColumnAccess { TABLE *table_; MY_BITMAP *bitmap_; -#ifndef DBUG_OFF +#ifdef DBUG_ASSERT_EXISTS my_bitmap_map *map_; #endif public: diff --git a/storage/rocksdb/rdb_datadic.h b/storage/rocksdb/rdb_datadic.h index 9c7cd956eb3..91e8fb6f389 100644 --- a/storage/rocksdb/rdb_datadic.h +++ b/storage/rocksdb/rdb_datadic.h @@ -603,6 +603,10 @@ public: const int storage_length = static_cast<int>(max_storage_fmt_length()); return (storage_length - offset) >= needed; } +#else + inline bool is_storage_available(const int &offset, const int &needed) const { + return 1; + } #endif // DBUG_OFF /* Global number of this index (used as prefix in StorageFormat) */ diff --git a/storage/tokudb/tokudb_thread.h b/storage/tokudb/tokudb_thread.h index dcb1fd6ec63..72eb17ea05a 100644 --- a/storage/tokudb/tokudb_thread.h +++ b/storage/tokudb/tokudb_thread.h @@ -235,19 +235,19 @@ inline mutex_t::mutex_t(void) { _owners = 0; _owner = _null_owner; #endif - int r = pthread_mutex_init(&_mutex, MY_MUTEX_INIT_FAST); + int r __attribute__((unused)) = pthread_mutex_init(&_mutex, MY_MUTEX_INIT_FAST); assert_debug(r == 0); } inline mutex_t::~mutex_t(void) { #ifdef TOKUDB_DEBUG assert_debug(_owners == 0); #endif - int r = pthread_mutex_destroy(&_mutex); + int r __attribute__((unused)) = pthread_mutex_destroy(&_mutex); assert_debug(r == 0); } inline void mutex_t::lock(void) { assert_debug(is_owned_by_me() == false); - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); #ifdef TOKUDB_DEBUG _owners++; @@ -274,7 +274,7 @@ inline void mutex_t::unlock(void) { _owners--; _owner = _null_owner; #endif - int r = pthread_mutex_unlock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_unlock(&_mutex); assert_debug(r == 0); } #ifdef TOKUDB_DEBUG @@ -285,11 +285,11 @@ inline bool mutex_t::is_owned_by_me(void) const { inline rwlock_t::rwlock_t(void) { - int r = pthread_rwlock_init(&_rwlock, NULL); + int r __attribute__((unused)) = pthread_rwlock_init(&_rwlock, NULL); assert_debug(r == 0); } inline rwlock_t::~rwlock_t(void) { - int r = pthread_rwlock_destroy(&_rwlock); + int r __attribute__((unused)) = pthread_rwlock_destroy(&_rwlock); assert_debug(r == 0); } inline void rwlock_t::lock_read(void) { @@ -345,7 +345,7 @@ inline int rwlock_t::lock_write(ulonglong microseconds) { return r; } inline void rwlock_t::unlock(void) { - int r = pthread_rwlock_unlock(&_rwlock); + int r __attribute__((unused)) = pthread_rwlock_unlock(&_rwlock); assert_debug(r == 0); } inline rwlock_t::rwlock_t(const rwlock_t&) { @@ -358,7 +358,7 @@ inline rwlock_t& rwlock_t::operator=(const rwlock_t&) { inline event_t::event_t(bool create_signalled, bool manual_reset) : _manual_reset(manual_reset) { - int r = pthread_mutex_init(&_mutex, NULL); + int __attribute__((unused)) r = pthread_mutex_init(&_mutex, NULL); assert_debug(r == 0); r = pthread_cond_init(&_cond, NULL); assert_debug(r == 0); @@ -370,13 +370,13 @@ inline event_t::event_t(bool create_signalled, bool manual_reset) : _pulsed = false; } inline event_t::~event_t(void) { - int r = pthread_mutex_destroy(&_mutex); + int r __attribute__((unused)) = pthread_mutex_destroy(&_mutex); assert_debug(r == 0); r = pthread_cond_destroy(&_cond); assert_debug(r == 0); } inline void event_t::wait(void) { - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); while (_signalled == false && _pulsed == false) { r = pthread_cond_wait(&_cond, &_mutex); @@ -413,7 +413,7 @@ inline int event_t::wait(ulonglong microseconds) { return 0; } inline void event_t::signal(void) { - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); _signalled = true; if (_manual_reset) { @@ -427,7 +427,7 @@ inline void event_t::signal(void) { assert_debug(r == 0); } inline void event_t::pulse(void) { - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); _pulsed = true; r = pthread_cond_signal(&_cond); @@ -437,7 +437,7 @@ inline void event_t::pulse(void) { } inline bool event_t::signalled(void) { bool ret = false; - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); ret = _signalled; r = pthread_mutex_unlock(&_mutex); @@ -445,7 +445,7 @@ inline bool event_t::signalled(void) { return ret; } inline void event_t::reset(void) { - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); _signalled = false; _pulsed = false; @@ -467,21 +467,21 @@ inline semaphore_t::semaphore_t( _initial_count(initial_count), _max_count(max_count) { - int r = pthread_mutex_init(&_mutex, NULL); + int r __attribute__((unused)) = pthread_mutex_init(&_mutex, NULL); assert_debug(r == 0); r = pthread_cond_init(&_cond, NULL); assert_debug(r == 0); _signalled = _initial_count; } inline semaphore_t::~semaphore_t(void) { - int r = pthread_mutex_destroy(&_mutex); + int r __attribute__((unused)) = pthread_mutex_destroy(&_mutex); assert_debug(r == 0); r = pthread_cond_destroy(&_cond); assert_debug(r == 0); } inline semaphore_t::E_WAIT semaphore_t::wait(void) { E_WAIT ret; - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); while (_signalled == 0 && _interrupted == false) { r = pthread_cond_wait(&_cond, &_mutex); @@ -524,7 +524,7 @@ inline semaphore_t::E_WAIT semaphore_t::wait(ulonglong microseconds) { } inline bool semaphore_t::signal(void) { bool ret = false; - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); if (_signalled < _max_count) { _signalled++; @@ -538,7 +538,7 @@ inline bool semaphore_t::signal(void) { } inline int semaphore_t::signalled(void) { int ret = 0; - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); ret = _signalled; r = pthread_mutex_unlock(&_mutex); @@ -546,7 +546,7 @@ inline int semaphore_t::signalled(void) { return ret; } inline void semaphore_t::reset(void) { - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); _signalled = 0; r = pthread_mutex_unlock(&_mutex); @@ -554,7 +554,7 @@ inline void semaphore_t::reset(void) { return; } inline void semaphore_t::set_interrupt(void) { - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); _interrupted = true; r = pthread_cond_broadcast(&_cond); @@ -563,7 +563,7 @@ inline void semaphore_t::set_interrupt(void) { assert_debug(r == 0); } inline void semaphore_t::clear_interrupt(void) { - int r = pthread_mutex_lock(&_mutex); + int r __attribute__((unused)) = pthread_mutex_lock(&_mutex); assert_debug(r == 0); _interrupted = false; r = pthread_mutex_unlock(&_mutex); |