Skip to content

Commit 4a611f7

Browse files
committed
Bug#31037561 enable doc-comment warnings for storage/innobase/
- enabled doc-comment warnings for subdirs depending on storage/innobase/ - removed @param that refer to non-existent arguments - added unused, but documented parameters as [[maybe_unused]] - fixed one-line doc-comments - removed @return for functions that return void. - fixed unintended HTML uses in doc-comments - added descriptions for @RetVal - conditional doc-comment if UNIV_HOTBACKUP is defined Change-Id: I12f8cb1cff4cdbd815dc62146bd350b49c18d27c
1 parent ef2bc58 commit 4a611f7

File tree

17 files changed

+39
-33
lines changed

17 files changed

+39
-33
lines changed

storage/innobase/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
INCLUDE(innodb.cmake)
2626

2727
MSVC_CPPCHECK_DISABLE()
28-
# TODO: remove when all -Wdocumentation warnings are fixed.
29-
DISABLE_DOCUMENTATION_WARNINGS()
28+
IF(NOT WITH_DEBUG)
29+
# the innodb parts are documented assuming WITH_DEBUG (UNIV_DEBUG)
30+
DISABLE_DOCUMENTATION_WARNINGS()
31+
ENDIF()
3032

3133
ADD_DEFINITIONS(-DLOG_SUBSYSTEM_TAG="InnoDB")
3234

storage/innobase/buf/buf0flu.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3123,8 +3123,7 @@ void buf_flush_page_cleaner_disabled_debug_update(THD *, SYS_VAR *, void *,
31233123
#endif /* UNIV_DEBUG */
31243124

31253125
/** Thread tasked with flushing dirty pages from the buffer pools.
3126-
As of now we'll have only one coordinator.
3127-
@param[in] n_page_cleaners Number of page cleaner threads to create */
3126+
As of now we'll have only one coordinator. */
31283127
static void buf_flush_page_coordinator_thread() {
31293128
auto loop_start_time = std::chrono::steady_clock::now();
31303129
ulint n_flushed = 0;

storage/innobase/dict/dict0dd.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,6 @@ static bool dd_index_match(const dict_index_t *index, const Index *dd_index) {
239239
return match;
240240
}
241241

242-
/** Check if the InnoDB table is consistent with dd::Table
243-
@tparam Table dd::Table or dd::Partition
244-
@param[in] table InnoDB table
245-
@param[in] dd_table dd::Table or dd::Partition
246-
@return true if match
247-
@retval false if not match */
248242
template <typename Table>
249243
bool dd_table_match(const dict_table_t *table, const Table *dd_table) {
250244
/* Temporary table has no metadata written */

storage/innobase/dict/dict0sdi.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ when SDI is corrupted.
164164
@param[in,out] tablespace tablespace object
165165
@retval false success
166166
@retval true failure */
167-
bool dict_sdi_drop(dd::Tablespace *) {
167+
bool dict_sdi_drop(dd::Tablespace *tablespace [[maybe_unused]]) {
168168
#if 0 /* TODO: Enable in WL#9761 */
169169
uint32 space_id;
170170
if (dict_sdi_exists(tablespace, &space_id)

storage/innobase/handler/ha_innopart.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,9 @@ inline int ha_innopart::initialize_auto_increment(bool) {
777777
@param[in] table_def dd::Table describing table to be opened
778778
@retval 1 if error
779779
@retval 0 if success */
780-
int ha_innopart::open(const char *name, int, uint, const dd::Table *table_def) {
780+
int ha_innopart::open(const char *name, int mode [[maybe_unused]],
781+
uint test_if_locked [[maybe_unused]],
782+
const dd::Table *table_def) {
781783
dict_table_t *ib_table;
782784
char norm_name[FN_REFLEN];
783785
THD *thd;

storage/innobase/handler/handler0alter.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -846,9 +846,9 @@ static inline Instant_Type innobase_support_instant(
846846
COLUMN_RENAME_ONLY, /*!< Only column RENAME */
847847
VIRTUAL_ADD_DROP_ONLY, /*!< Only virtual column ADD AND DROP */
848848
VIRTUAL_ADD_DROP_WITH_RENAME, /*!< Virtual column ADD/DROP with RENAME */
849-
INSTANT_ADD, /*< INSTANT ADD possibly with virtual column ADD and
849+
INSTANT_ADD, /*!< INSTANT ADD possibly with virtual column ADD and
850850
column RENAME */
851-
INSTANT_DROP, /*|< INSTANT DROP possibly with virtual column ADD/DROP and
851+
INSTANT_DROP, /*!< INSTANT DROP possibly with virtual column ADD/DROP and
852852
column RENAME */
853853
NONE
854854
};
@@ -3578,7 +3578,7 @@ PK columns follows rule(2);
35783578
@param[in] old_clust_index index to be compared
35793579
@param[in] new_clust_index index to be compared
35803580
@retval true if both indexes have same order.
3581-
@retval false. */
3581+
@retval false . */
35823582
[[nodiscard]] static bool innobase_pk_order_preserved(
35833583
const ulint *col_map, const dict_index_t *old_clust_index,
35843584
const dict_index_t *new_clust_index) {

storage/innobase/handler/p_s.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ void Innodb_data_lock_inspector::destroy_data_lock_wait_iterator(
432432
@param[in] id_str The identifier string
433433
@param[out] cached_id The cached identifier string
434434
@param[out] cached_id_length The cached identifier string length
435-
@returns string allocated in the performance schema container.
436435
*/
437436
void alloc_identifier(PSI_server_data_lock_container *container,
438437
PSI_identifier kind, const std::string &id_str,

storage/innobase/include/arch0arch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ class Arch_File_Ctx {
697697
@return true if both sets of information are the same
698698
@param[in] group group whose file is being validated
699699
@param[in] file_index index of the file which is being validated
700-
@param[in] start_lsn
700+
@param[in] start_lsn start LSN
701701
@param[in,out] reset_count count of files which has been validated
702702
@return true if both the sets of information are the same. */
703703
bool validate(Arch_Group *group, uint file_index, lsn_t start_lsn,

storage/innobase/include/row0pread-adapter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Parallel_reader_adapter {
6565
@param[in] trx Transaction used for parallel read.
6666
@param[in] config (Cluster) Index scan configuration.
6767
@param[in] f Callback function.
68-
@retval error. */
68+
@returns error. */
6969
[[nodiscard]] dberr_t add_scan(trx_t *trx,
7070
const Parallel_reader::Config &config,
7171
Parallel_reader::F &&f);

storage/innobase/include/ut0rnd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ extern thread_local uint64_t random_seed;
127127

128128
/** A helper method, it is used by hash_binary_ib for backward compatibility.
129129
NOTE: Do not use this method, it produces results that are not hashed well.
130-
Especially for sequences of pairs of <i+n, j+n> over n. */
130+
Especially for sequences of pairs of \<i+n, j+n\> over n. */
131131
constexpr uint32_t hash_uint32_pair_ib(uint32_t n1, uint32_t n2) {
132132
constexpr uint32_t HASH_RANDOM_MASK = 1463735687;
133133
constexpr uint32_t HASH_RANDOM_MASK2 = 1653893711;

storage/innobase/log/log0files_governor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ log.writer_mutex acquired iff has_writer_mutex is true.
574574
@param[in,out] log redo log
575575
@param[in] has_writer_mutex true iff this thread has log.writer_mutex
576576
acquired
577-
@return @see Log_files_governor_iteration_result */
577+
@return @ref Log_files_governor_iteration_result */
578578
static Log_files_governor_iteration_result log_files_governor_iteration_low(
579579
log_t &log, bool has_writer_mutex);
580580

storage/innobase/log/log0recv.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,13 +2529,21 @@ bool recv_page_is_brand_new(buf_block_t *block) {
25292529
return false;
25302530
}
25312531

2532+
#ifndef UNIV_HOTBACKUP
25322533
/** Applies the hashed log records to the page, if the page lsn is less than
25332534
the lsn of a log record. This can be called when a buffer page has just been
25342535
read in, or also for a page already in the buffer pool.
25352536
25362537
@param[in] just_read_in true if the IO handler calls this for a freshly
25372538
read page
25382539
@param[in,out] block buffer block */
2540+
#else
2541+
/** Applies the hashed log records to the page, if the page lsn is less than
2542+
the lsn of a log record. This can be called when a buffer page has just been
2543+
read in, or also for a page already in the buffer pool.
2544+
2545+
@param[in,out] block buffer block */
2546+
#endif
25392547
void recv_recover_page_func(
25402548
#ifndef UNIV_HOTBACKUP
25412549
bool just_read_in,

storage/innobase/os/os0file.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3752,8 +3752,6 @@ ssize_t SyncFileIO::execute(const IORequest &request) {
37523752

37533753
/** Free storage space associated with a section of the file.
37543754
@param[in] fh Open file handle
3755-
@param[in] page_size Tablespace page size
3756-
@param[in] block_size File system block size
37573755
@param[in] off Starting offset (SEEK_SET)
37583756
@param[in] len Size of the hole
37593757
@return 0 on success or errno */

storage/innobase/row/row0ins.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,8 +2279,8 @@ of a clustered index entry.
22792279
@param[in] thd client connection, or NULL
22802280
@param[in] index clustered index
22812281
@return error code
2282-
@retval DB_SUCCESS
2283-
@retval DB_OUT_OF_FILE_SPACE */
2282+
@retval DB_SUCCESS success
2283+
@retval DB_OUT_OF_FILE_SPACE out of file-space */
22842284
static dberr_t row_ins_index_entry_big_rec_func(
22852285
trx_t *trx, const dtuple_t *entry, const big_rec_t *big_rec, ulint *offsets,
22862286
mem_heap_t **heap, IF_DEBUG(const THD *thd, ) dict_index_t *index) {

storage/innobase/trx/trx0undo.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,9 +1542,9 @@ void trx_undo_mem_free(trx_undo_t *undo) /*!< in: the undo object to be freed */
15421542
@param[out] undo the new undo log object, undefined if did not succeed
15431543
@param[in] mtr mini-transation
15441544
@retval DB_SUCCESS if successful in creating the new undo lob object,
1545-
@retval DB_TOO_MANY_CONCURRENT_TRXS
1546-
@retval DB_OUT_OF_FILE_SPACE
1547-
@retval DB_OUT_OF_MEMORY */
1545+
@retval DB_TOO_MANY_CONCURRENT_TRXS too many concurrent trxs
1546+
@retval DB_OUT_OF_FILE_SPACE out of file-space
1547+
@retval DB_OUT_OF_MEMORY out of memory */
15481548
[[nodiscard]] static dberr_t trx_undo_create(
15491549
trx_rseg_t *rseg, ulint type, trx_id_t trx_id, const XID *xid,
15501550
trx_undo_t::Gtid_storage gtid_storage, trx_undo_t **undo, mtr_t *mtr) {

unittest/gunit/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ IF(NOT WITH_UNIT_TESTS)
2525
ENDIF()
2626

2727
MSVC_CPPCHECK_DISABLE()
28-
# TODO: remove when all -Wdocumentation warnings are fixed.
29-
# - storage/innobase/
30-
DISABLE_DOCUMENTATION_WARNINGS()
28+
29+
IF(NOT WITH_DEBUG)
30+
# the innodb parts are documented assuming WITH_DEBUG (UNIV_DEBUG)
31+
DISABLE_DOCUMENTATION_WARNINGS()
32+
ENDIF()
3133

3234
# Some tests require Boost.
3335
INCLUDE_DIRECTORIES(SYSTEM ${BOOST_PATCHES_DIR} ${BOOST_INCLUDE_DIR})

utilities/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
ADD_WSHADOW_WARNING()
2424
DISABLE_MISSING_PROFILE_WARNING()
2525
MSVC_CPPCHECK_DISABLE()
26-
# TODO: remove when all -Wdocumentation warnings are fixed.
27-
# - storage/innobase
28-
DISABLE_DOCUMENTATION_WARNINGS()
26+
27+
IF(NOT WITH_DEBUG)
28+
# the innodb parts are documented assuming WITH_DEBUG (UNIV_DEBUG)
29+
DISABLE_DOCUMENTATION_WARNINGS()
30+
ENDIF()
2931

3032
IF(NOT CMAKE_CROSSCOMPILING)
3133
MYSQL_ADD_EXECUTABLE(comp_err

0 commit comments

Comments
 (0)