From 56948ee54c9d113f07f725ebdc560d1919fc6676 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 10 Jan 2023 10:45:03 +1100 Subject: clang15 warnings - unused vars and old prototypes clang15 finally errors on old prototype definations. Its also a lot fussier about variables that aren't used as is the case a number of time with loop counters that aren't examined. RocksDB was complaining that its get_range function was declared without the array length in ha_rocksdb.h. While a constant is used rather than trying to import the Rdb_key_def::INDEX_NUMBER_SIZE header (was causing a lot of errors on the defination of other orders). If the constant does change can be assured that the same compile warnings will tell us of the error. The ha_rocksdb::index_read_map_impl DBUG_EXECUTE_IF was similar to the existing endless functions used in replication tests. Its rather moot point as the rocksdb.force_shutdown test that uses myrocks_busy_loop_on_row_read is currently disabled. --- storage/rocksdb/ha_rocksdb.cc | 5 +---- storage/rocksdb/ha_rocksdb.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'storage/rocksdb') diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index b1a64b4aec0..502dd647a27 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -8468,8 +8468,7 @@ int ha_rocksdb::index_read_map_impl(uchar *const buf, const uchar *const key, const key_range *end_key) { DBUG_ENTER_FUNC(); - DBUG_EXECUTE_IF("myrocks_busy_loop_on_row_read", int debug_i = 0; - while (1) { debug_i++; }); + DBUG_EXECUTE_IF("myrocks_busy_loop_on_row_read", my_sleep(50000);); int rc = 0; @@ -12124,7 +12123,6 @@ static int calculate_stats( } } - int num_sst = 0; for (const auto &it : props) { std::vector sst_stats; Rdb_tbl_prop_coll::read_stats_from_tbl_props(it.second, &sst_stats); @@ -12153,7 +12151,6 @@ static int calculate_stats( stats[it1.m_gl_index_id].merge( it1, true, it_index->second->max_storage_fmt_length()); } - num_sst++; } if (include_memtables) { diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index 758ca71fc95..6211c7ebc04 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -401,7 +401,7 @@ class ha_rocksdb : public my_core::handler { void free_key_buffers(); // the buffer size should be at least 2*Rdb_key_def::INDEX_NUMBER_SIZE - rocksdb::Range get_range(const int i, uchar buf[]) const; + rocksdb::Range get_range(const int i, uchar buf[2 * 4]) const; /* Perf timers for data reads -- cgit v1.2.1