Commit 3d9b350a authored by Marko Mäkelä's avatar Marko Mäkelä

Fix clang -Wunused-but-set-variable

parent 89e3815b
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2020, MariaDB Corporation.
Copyright (c) 2017, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -575,7 +575,6 @@ dtuple_convert_big_rec(
dfield_t* dfield;
dict_field_t* ifield;
ulint size;
ulint n_fields;
ulint local_prefix_len;
if (!dict_index_is_clust(index)) {
......@@ -604,7 +603,7 @@ dtuple_convert_big_rec(
a variable-length field that yields the biggest savings when
stored externally */
n_fields = 0;
ut_d(ulint n_fields = 0);
while (page_zip_rec_needs_ext(rec_get_converted_size(index, entry,
*n_ext),
......@@ -700,9 +699,8 @@ dtuple_convert_big_rec(
dfield_set_data(dfield, data, local_len);
dfield_set_ext(dfield);
n_fields++;
(*n_ext)++;
ut_ad(n_fields < dtuple_get_n_fields(entry));
ut_ad(++n_fields < dtuple_get_n_fields(entry));
if (upd && !upd->is_modified(longest_i)) {
......
......@@ -998,7 +998,7 @@ rtr_page_split_and_insert(
lock_prdt_t new_prdt;
rec_t* first_rec = NULL;
int first_rec_group = 1;
ulint n_iterations = 0;
IF_DBUG(bool iterated = false,);
if (!*heap) {
*heap = mem_heap_create(1024);
......@@ -1207,7 +1207,7 @@ rtr_page_split_and_insert(
the page, and it'll need the second round split in this case.
We test this scenario here*/
DBUG_EXECUTE_IF("rtr_page_need_second_split",
if (n_iterations == 0) {
if (!iterated) {
rec = NULL;
goto after_insert; }
);
......@@ -1272,7 +1272,7 @@ rtr_page_split_and_insert(
parent. */
rtr_clean_rtr_info(cursor->rtr_info, true);
cursor->rtr_info = NULL;
n_iterations++;
IF_DBUG(iterated=true,);
rec_t* i_rec = page_rec_get_next(page_get_infimum_rec(
buf_block_get_frame(block)));
......
/*****************************************************************************
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation.
Copyright (c) 2019, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -25,8 +25,7 @@ Created 9/10/1995 Heikki Tuuri
Rewritten by Sunny Bains Dec 2011.
***********************************************************************/
#ifndef ut0lst_h
#define ut0lst_h
#pragma once
/* Do not include univ.i because univ.i includes this. */
......@@ -474,17 +473,17 @@ template <typename List, class Functor>
void ut_list_validate(const List& list, Functor& functor)
{
ut_list_map(list, functor);
#ifdef UNIV_DEBUG
/* Validate the list backwards. */
ulint count = 0;
auto count = list.count;
for (typename List::elem_type* elem = list.end;
elem != 0;
elem = (elem->*list.node).prev) {
++count;
--count;
}
ut_a(count == list.count);
ut_ad(!count);
#endif
}
/** Check the consistency of a doubly linked list.
......@@ -494,23 +493,24 @@ template <typename List, class Functor>
inline void ut_list_validate(const List& list, const Functor& functor)
{
ut_list_map(list, functor);
#ifdef UNIV_DEBUG
/* Validate the list backwards. */
ulint count = 0;
auto count = list.count;
for (typename List::elem_type* elem = list.end;
elem != 0;
elem = (elem->*list.node).prev) {
++count;
--count;
}
ut_a(count == list.count);
ut_ad(!count);
#endif
}
template <typename List>
inline void ut_list_validate(const List& list)
{
ut_list_validate(list, NullValidate());
ut_d(ut_list_validate(list, NullValidate()));
}
#ifdef UNIV_DEBUG
......@@ -561,8 +561,3 @@ ut_list_move_to_front(
ut_list_prepend(list, elem);
}
}
#ifdef UNIV_DEBUG
#endif
#endif /* ut0lst.h */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment