summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-10-25 11:26:37 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-10-25 11:26:37 +0300
commit9a0b9e336081619d88211d17895e3e7f8030ab3f (patch)
treedff672703c5309b1e34227330ea027ab13e6c29a /storage/innobase
parent2f7a0072b6f343051fc2dbd77ea46519617b94ab (diff)
parent667d3fbbb51044b20d23150992adbbad1f04aad8 (diff)
downloadmariadb-git-9a0b9e336081619d88211d17895e3e7f8030ab3f.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'storage/innobase')
-rw-r--r--storage/innobase/data/data0data.cc8
-rw-r--r--storage/innobase/gis/gis0rtree.cc6
-rw-r--r--storage/innobase/handler/ha_innodb.cc5
-rw-r--r--storage/innobase/include/ut0lst.h31
4 files changed, 24 insertions, 26 deletions
diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc
index 14a0b3e19fd..0e485e58215 100644
--- a/storage/innobase/data/data0data.cc
+++ b/storage/innobase/data/data0data.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
@@ -579,7 +579,6 @@ dtuple_convert_big_rec(
big_rec_t* vector;
dfield_t* dfield;
ulint size;
- ulint n_fields;
ulint local_prefix_len;
if (!dict_index_is_clust(index)) {
@@ -615,7 +614,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);
uint16_t longest_i;
ulint longest;
@@ -731,9 +730,8 @@ ext_write:
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)) {
diff --git a/storage/innobase/gis/gis0rtree.cc b/storage/innobase/gis/gis0rtree.cc
index b529d5ebef5..a4fbf70e7a1 100644
--- a/storage/innobase/gis/gis0rtree.cc
+++ b/storage/innobase/gis/gis0rtree.cc
@@ -902,7 +902,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);
@@ -1119,7 +1119,7 @@ func_start:
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; }
);
@@ -1183,7 +1183,7 @@ after_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)));
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index fb8b0180c3d..5af52a3240d 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -7227,6 +7227,11 @@ ha_innobase::build_template(
m_prebuilt->versioned_write = table->versioned_write(VERS_TRX_ID);
m_prebuilt->need_to_access_clustered = (index == clust_index);
+ if (m_prebuilt->in_fts_query) {
+ /* Do clustered index lookup to fetch the FTS_DOC_ID */
+ m_prebuilt->need_to_access_clustered = true;
+ }
+
/* Either m_prebuilt->index should be a secondary index, or it
should be the clustered index. */
ut_ad(dict_index_is_clust(index) == (index == clust_index));
diff --git a/storage/innobase/include/ut0lst.h b/storage/innobase/include/ut0lst.h
index 9a5f3059826..7b7ed7b8e80 100644
--- a/storage/innobase/include/ut0lst.h
+++ b/storage/innobase/include/ut0lst.h
@@ -1,7 +1,7 @@
/*****************************************************************************
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;
+ ulint 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;
+ ulint 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 */